It reports the following error:
Traceback (most recent call last):
File "tools/pytorch2onnx.py", line 393, in
dynamic_export=args.dynamic_export)
File "tools/pytorch2onnx.py", line 204, in pytorch2onnx
dynamic_axes=dynamic_axes)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/init.py", line 365, in export
export_modules_as_functions,
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/utils.py", line 178, in export
export_modules_as_functions=export_modules_as_functions,
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/utils.py", line 1084, in _export
dynamic_axes=dynamic_axes,
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/utils.py", line 727, in _model_to_graph
graph, params, torch_out, module = _create_jit_graph(model, args)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/utils.py", line 602, in _create_jit_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/utils.py", line 518, in _trace_and_get_graph_from_model
model, args, strict=False, _force_outplace=False, _return_inputs_states=True
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/jit/_trace.py", line 1175, in _get_trace_graph
outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, kwargs)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, kwargs)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/jit/_trace.py", line 132, in forward
self._force_outplace,
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/jit/_trace.py", line 118, in wrapper
outs.append(self.inner(trace_inputs))
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(input, kwargs)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1118, in _slow_forward
result = self.forward(*input, kwargs)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 116, in new_func
return old_func(*args, **kwargs)
TypeError: forward() got multiple values for argument 'img_metas'
I try pytorch2onnx.
It reports the following error: Traceback (most recent call last): File "tools/pytorch2onnx.py", line 393, in
dynamic_export=args.dynamic_export)
File "tools/pytorch2onnx.py", line 204, in pytorch2onnx
dynamic_axes=dynamic_axes)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/init.py", line 365, in export
export_modules_as_functions,
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/utils.py", line 178, in export
export_modules_as_functions=export_modules_as_functions,
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/utils.py", line 1084, in _export
dynamic_axes=dynamic_axes,
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/utils.py", line 727, in _model_to_graph
graph, params, torch_out, module = _create_jit_graph(model, args)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/utils.py", line 602, in _create_jit_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/onnx/utils.py", line 518, in _trace_and_get_graph_from_model
model, args, strict=False, _force_outplace=False, _return_inputs_states=True
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/jit/_trace.py", line 1175, in _get_trace_graph
outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, kwargs)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, kwargs)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/jit/_trace.py", line 132, in forward
self._force_outplace,
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/jit/_trace.py", line 118, in wrapper
outs.append(self.inner(trace_inputs))
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(input, kwargs)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1118, in _slow_forward
result = self.forward(*input, kwargs)
File "/home/research/wangjing/anaconda3/envs/openmmlab/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 116, in new_func
return old_func(*args, **kwargs)
TypeError: forward() got multiple values for argument 'img_metas'
How can I solve it? Thank you !