mmpose icon indicating copy to clipboard operation
mmpose copied to clipboard

How to convert i3d_nvgesture_bbox_112x112_fps15-363b5956_20220530.pth to onnx

Open sunaral opened this issue 2 years ago • 1 comments

run the command: python3 tools/deployment/pytorch2onnx.py configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_112x112_fps15_rgb.py checkpoints/i3d_nvgesture_bbox_112x112_fps15-363b5956_20220530.pth

error: Traceback (most recent call last): File "tools/deployment/pytorch2onnx.py", line 159, in pytorch2onnx( File "tools/deployment/pytorch2onnx.py", line 67, in pytorch2onnx torch.onnx.export( File "/usr/local/lib/python3.8/dist-packages/torch/onnx/init.py", line 275, in export return utils.export(model, args, f, export_params, verbose, training, File "/usr/local/lib/python3.8/dist-packages/torch/onnx/utils.py", line 88, in export _export(model, args, f, export_params, verbose, training, input_names, output_names, File "/usr/local/lib/python3.8/dist-packages/torch/onnx/utils.py", line 689, in _export _model_to_graph(model, args, verbose, input_names, File "/usr/local/lib/python3.8/dist-packages/torch/onnx/utils.py", line 458, in _model_to_graph graph, params, torch_out, module = _create_jit_graph(model, args, File "/usr/local/lib/python3.8/dist-packages/torch/onnx/utils.py", line 422, in _create_jit_graph graph, torch_out = _trace_and_get_graph_from_model(model, args) File "/usr/local/lib/python3.8/dist-packages/torch/onnx/utils.py", line 373, in _trace_and_get_graph_from_model torch.jit._get_trace_graph(model, args, strict=False, _force_outplace=False, _return_inputs_states=True) File "/usr/local/lib/python3.8/dist-packages/torch/jit/_trace.py", line 1160, in _get_trace_graph outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/usr/local/lib/python3.8/dist-packages/torch/jit/_trace.py", line 127, in forward graph, out = torch._C._create_graph_by_tracing( File "/usr/local/lib/python3.8/dist-packages/torch/jit/_trace.py", line 118, in wrapper outs.append(self.inner(*trace_inputs)) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1039, in _slow_forward result = self.forward(*input, **kwargs) File "/mmpose/mmpose/models/detectors/gesture_recognizer.py", line 185, in forward_dummy raise NotImplementedError NotImplementedError

sunaral avatar Jan 10 '23 09:01 sunaral

Hi @sunaral , gesture model is not supported to export right now. If you want to export this model, I think you need to implement a forward_dummy() refer to forward_test(). We are not planning to support this feature in the near future.

Tau-J avatar Jan 12 '23 10:01 Tau-J