|
When I convert pytorch to onnx;
Traceback (most recent call last):
File "eval.py", line 940, in <module>
model_onnx_path)
File "/usr/local/lib/python3.5/dist-packages/torch/onnx/__init__.py", line 27, in export
return utils.export(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 104, in export
operator_export_type=operator_export_type)
File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 281, in _export
example_outputs, propagate)
File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 224, in _model_to_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args, training)
File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 192, in _trace_and_get_graph_from_model
trace, torch_out = torch.jit.get_trace_graph(model, args, _force_outplace=True)
File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 39, in set_training
yield
File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 192, in _trace_and_get_graph_from_model
trace, torch_out = torch.jit.get_trace_graph(model, args, _force_outplace=True)
File "/usr/local/lib/python3.5/dist-packages/torch/jit/__init__.py", line 197, in get_trace_graph
return LegacyTracedModule(f, _force_outplace)(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 489, in __call__
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/torch/jit/__init__.py", line 253, in forward
out_vars, _ = _flatten(out)
RuntimeError: Only tuples, lists and Variables supported as JIT inputs, but got dict
I could not figure out where is wrong, seems ONNX sets some limitations for its usage.
Hope direct pytorch conversion could be released ASAP |
|