/veesion/DetectoRS/mmdet/ops/dcn/deform_conv.py:108: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this
value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
if not all(map(lambda s: s > 0, output_size)):
Traceback (most recent call last):
File "tools/pytorch2onnx.py", line 125, in <module>
main()
File "tools/pytorch2onnx.py", line 117, in main
onnx_model = export_onnx_model(model, (input_data, ), args.passes)
File "tools/pytorch2onnx.py", line 44, in export_onnx_model
operator_export_type=OperatorExportTypes.ONNX_ATEN_FALLBACK,
File "/usr/local/lib/python3.6/dist-packages/torch/onnx/__init__.py", line 148, in export
strip_doc_string, dynamic_axes, keep_initializers_as_inputs)
File "/usr/local/lib/python3.6/dist-packages/torch/onnx/utils.py", line 66, in export
dynamic_axes=dynamic_axes, keep_initializers_as_inputs=keep_initializers_as_inputs)
File "/usr/local/lib/python3.6/dist-packages/torch/onnx/utils.py", line 416, in _export
fixed_batch_size=fixed_batch_size)
File "/usr/local/lib/python3.6/dist-packages/torch/onnx/utils.py", line 279, in _model_to_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args, training)
File "/usr/local/lib/python3.6/dist-packages/torch/onnx/utils.py", line 236, in _trace_and_get_graph_from_model
trace_graph, torch_out, inputs_states = torch.jit._get_trace_graph(model, args, _force_outplace=True, _return_inputs_states=True) [31/1980]
File "/usr/local/lib/python3.6/dist-packages/torch/jit/__init__.py", line 277, in _get_trace_graph
outs = ONNXTracedModule(f, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 532, in __call__
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/jit/__init__.py", line 360, in forward
self._force_outplace,
File "/usr/local/lib/python3.6/dist-packages/torch/jit/__init__.py", line 347, in wrapper
outs.append(self.inner(*trace_inputs))
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 530, in __call__
result = self._slow_forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 516, in _slow_forward
result = self.forward(*input, **kwargs)
File "/veesion/DetectoRS/mmdet/models/detectors/htc.py", line 160, in forward_dummy
x = self.extract_feat(img)
File "/veesion/DetectoRS/mmdet/models/detectors/rfp.py", line 98, in extract_feat
x = self.backbone(img) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 530, in __call__
result = self._slow_forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 516, in _slow_forward
result = self.forward(*input, **kwargs) File "/veesion/DetectoRS/mmdet/models/backbones/resnet.py", line 590, in forward x = res_layer(x) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 530, in __call__
result = self._slow_forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 516, in _slow_forward
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/container.py", line 100, in forward
input = module(input)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 530, in __call__
result = self._slow_forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 516, in _slow_forward
result = self.forward(*input, **kwargs)
File "/veesion/DetectoRS/mmdet/models/backbones/resnet.py", line 263, in forward
out = _inner_forward(x)
File "/veesion/DetectoRS/mmdet/models/backbones/resnet.py", line 240, in _inner_forward
out = self.conv2(out)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 530, in __call__
result = self._slow_forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 516, in _slow_forward
result = self.forward(*input, **kwargs)
File "/veesion/DetectoRS/mmdet/ops/saconv.py", line 95, in forward
1)
File "/veesion/DetectoRS/mmdet/ops/dcn/deform_conv.py", line 47, in forward
raise NotImplementedError
NotImplementedError
Seems like this model can't be exported to onnx ? Which model is compatible with the script you provide, please ?
Thanks for your error report and we appreciate it a lot.
Describe the bug pytorch2onnx.py is broken with available models
Reproduction
Environment
Error traceback
Seems like this model can't be exported to onnx ? Which model is compatible with the script you provide, please ?