Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytorch ssd to onnx error #50

Open
curry8 opened this issue May 6, 2019 · 0 comments
Open

pytorch ssd to onnx error #50

curry8 opened this issue May 6, 2019 · 0 comments

Comments

@curry8
Copy link

curry8 commented May 6, 2019

Hi,
I modeled your documents, converting my pytorch ssd model to onnx,
but it encounter a error:
Traceback (most recent call last):
File "test.py", line 28, in
test_voc()
File "test.py", line 21, in test_voc
torch.onnx.export(net,dummy_input,"./fire_ssd.proto",verbose=True)
File "/home/yt/.local/lib/python3.5/site-packages/torch/onnx/init.py", line 27, in export
return utils.export(*args, **kwargs)
File "/home/yt/.local/lib/python3.5/site-packages/torch/onnx/utils.py", line 104, in export
operator_export_type=operator_export_type)
File "/home/yt/.local/lib/python3.5/site-packages/torch/onnx/utils.py", line 281, in _export
example_outputs, propagate)
File "/home/yt/.local/lib/python3.5/site-packages/torch/onnx/utils.py", line 224, in _model_to_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args, training)
File "/home/yt/.local/lib/python3.5/site-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 "/home/yt/.local/lib/python3.5/site-packages/torch/onnx/utils.py", line 39, in set_training
yield
File "/home/yt/.local/lib/python3.5/site-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 "/home/yt/.local/lib/python3.5/site-packages/torch/jit/init.py", line 197, in get_trace_graph
return LegacyTracedModule(f, _force_outplace)(*args, **kwargs)
File "/home/yt/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/yt/.local/lib/python3.5/site-packages/torch/jit/init.py", line 252, in forward
out = self.inner(*trace_inputs)
File "/home/yt/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 487, in call
result = self._slow_forward(*input, **kwargs)
File "/home/yt/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in _slow_forward
result = self.forward(*input, **kwargs)
File "/home/yt/pytorch2onnx/ssd.py", line 103, in forward
self.priors.type(type(x.data)) # default boxes
RuntimeError: Attempted to trace Detect, but tracing of legacy functions is not supported
Do you have any advice,thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant