You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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!
The text was updated successfully, but these errors were encountered: