Repository navigation
Closed
Description
Description
I encounter the following error when running a flow (for example 7103) on a task (for example 146607).
<openml.flows.flow.OpenMLFlow object at 0x11cc43110> is not JSON serializable
Steps/Code to Reproduce
Example:
import openml
flow = openml.flows.get_flow(7103)
task = openml.tasks.get_task(146607)
run = runs.run_flow_on_task(task, flow)Expected Results
OpenMLRun object
Actual Results
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-102-f7fb112d9304> in <module>()
----> 1 run = runs.run_flow_on_task(task, flow)
/usr/local/lib/python2.7/site-packages/openml-0.7.0-py2.7.egg/openml/runs/functions.pyc in run_flow_on_task(task, flow, avoid_duplicate_runs, flow_tags, seed)
85 if avoid_duplicate_runs and flow_id:
86 flow_from_server = get_flow(flow_id)
---> 87 setup_id = setup_exists(flow_from_server, flow.model)
88 ids = _run_exists(task.task_id, setup_id)
89 if ids:
/usr/local/lib/python2.7/site-packages/openml-0.7.0-py2.7.egg/openml/setups/functions.pyc in setup_exists(flow, model)
44 raise ValueError('This should not happen!')
45
---> 46 openml_param_settings = openml.runs.OpenMLRun._parse_parameters(flow, model)
47 description = xmltodict.unparse(_to_dict(flow.flow_id,
48 openml_param_settings),
/usr/local/lib/python2.7/site-packages/openml-0.7.0-py2.7.egg/openml/runs/run.pyc in _parse_parameters(flow, model)
360 flow_dict = get_flow_dict(flow)
361 parameters = extract_parameters(flow, flow_dict, model,
--> 362 True, flow.flow_id)
363
364 return parameters
/usr/local/lib/python2.7/site-packages/openml-0.7.0-py2.7.egg/openml/runs/run.pyc in extract_parameters(_flow, _flow_dict, component_model, _main_call, main_id)
340 raise e
341 elif not isinstance(step, openml.flows.OpenMLFlow):
--> 342 raise e
343 continue
344 else:
TypeError: <openml.flows.flow.OpenMLFlow object at 0x11cc43110> is not JSON serializable
Versions
Darwin-17.5.0-x86_64-i386-64bit
('Python', '2.7.15 (default, May 28 2018, 14:20:45) \n[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)]')
('NumPy', '1.13.3')
('SciPy', '1.0.0')
('Scikit-Learn', '0.18.1')
('OpenML', '0.7.0')
Metadata
Metadata
Assignees
Labels
No labels
Activity
janvanrijn commentedon Jun 5, 2018
This code doesn't reproduce the same error on my side. Which branch are you running?
(Which is something we should fix though)
dbehrouz commentedon Jun 5, 2018
I'm getting the error on the master branch.
I will dig a bit deeper later (I think I got a similar error to yours when I was trying to run an "mlr" flow on the specified task).
dbehrouz commentedon Jun 6, 2018
@janvanrijn Running the same code on the develop shows a different error from the master branch and the one you got
mfeurer commentedon Jun 14, 2018
@d-behi and @janvanrijn I can reproduce this and will no try to figure out what's going wrong here.
mfeurer commentedon Jun 14, 2018
@d-behi I can reproduce your error on the development branch, too, using the following code:
mfeurer commentedon Jun 14, 2018
Replacing the
Noneby a list solves this issue:mfeurer commentedon Jun 14, 2018
Okay, I found the issue. When downloading the flow and not having the study14 package available, the flow will still deserialize and will actually have an empty step (for the imputation). However, the parameter extraction for the run upload cannot cope with this empty step. I will create a hotfix which gives a better error message.