-
Notifications
You must be signed in to change notification settings - Fork 658
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
KeyError: 'ori_shape' #311
Comments
Well, it does appear on the "experimental" list here https://mmdetection.readthedocs.io/en/latest/tutorials/pytorch2onnx.html#list-of-supported-models-exportable-to-onnx |
@RunningLeon mm系列封装的太多了 看起来晕呀 |
@leemengwei Hi, you could join our wechat group by adding assistant |
Closed for now. Feel free to reopen. |
Describe the bug
Hi, I'm trying to convert PointRend from Torch to either ONNX or TensorRT and no matter which config deploy_cfg file I choose, I keep getting the same error : KeyError: 'ori_shape'
Running the standard deploy.py with the MMDET model file for PointRend 3x.
According to the website, PointRend should be able to convert.
Here' the full error I get:
2022-04-04:18:06:58,root ERROR [utils.py:43] 'ori_shape'
Traceback (most recent call last):
File "c:\users\injectoforty\mmdeploy\mmdeploy\utils\utils.py", line 38, in target_wrapper
result = target(*args, **kwargs)
File "c:\users\injectoforty\mmdeploy\mmdeploy\apis\pytorch2onnx.py", line 109, in torch2onnx
torch2onnx_impl(
File "c:\users\injectoforty\mmdeploy\mmdeploy\apis\pytorch2onnx.py", line 44, in torch2onnx_impl
torch.onnx.export(
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\onnx_init_.py", line 305, in export
return utils.export(model, args, f, export_params, verbose, training,
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\onnx\utils.py", line 118, in export
_export(model, args, f, export_params, verbose, training, input_names, output_names,
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\onnx\utils.py", line 719, in _export
_model_to_graph(model, args, verbose, input_names,
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\onnx\utils.py", line 499, in _model_to_graph
graph, params, torch_out, module = _create_jit_graph(model, args)
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\onnx\utils.py", line 440, in _create_jit_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args)
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\onnx\utils.py", line 391, in _trace_and_get_graph_from_model
torch.jit._get_trace_graph(model, args, strict=False, _force_outplace=False, _return_inputs_states=True)
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\jit_trace.py", line 1166, in _get_trace_graph
outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\jit_trace.py", line 127, in forward
graph, out = torch._C._create_graph_by_tracing(
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\jit_trace.py", line 118, in wrapper
outs.append(self.inner(*trace_inputs))
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\torch\nn\modules\module.py", line 1098, in _slow_forward
result = self.forward(*input, **kwargs)
File "c:\users\injectoforty\mmdeploy\mmdeploy\core\rewriters\rewriter_utils.py", line 371, in wrapper
return self.func(self, *args, **kwargs)
File "c:\users\injectoforty\mmdeploy\mmdeploy\codebase\mmdet\models\detectors\base.py", line 69, in base_detector__forward
return __forward_impl(ctx, self, img, img_metas=img_metas, **kwargs)
File "c:\users\injectoforty\mmdeploy\mmdeploy\core\optimizers\function_marker.py", line 261, in g
rets = f(*args, **kwargs)
File "c:\users\injectoforty\mmdeploy\mmdeploy\codebase\mmdet\models\detectors\base.py", line 28, in __forward_impl
return self.simple_test(img, img_metas, **kwargs)
File "c:\users\injectoforty\mmdeploy\mmdeploy\core\rewriters\rewriter_utils.py", line 371, in wrapper
return self.func(self, *args, **kwargs)
File "c:\users\injectoforty\mmdeploy\mmdeploy\codebase\mmdet\models\detectors\two_stage.py", line 59, in two_stage_detector__simple_test
return self.roi_head.simple_test(x, proposals, img_metas, rescale=False)
File "c:\users\injectoforty\mmdeploy\mmdeploy\core\rewriters\rewriter_utils.py", line 371, in wrapper
return self.func(self, *args, **kwargs)
File "c:\users\injectoforty\mmdeploy\mmdeploy\codebase\mmdet\models\roi_heads\standard_roi_head.py", line 58, in standard_roi_head__simple_test
segm_results = self.simple_test_mask(
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\mmdet\models\roi_heads\point_rend_roi_head.py", line 162, in simple_test_mask
ori_shapes = tuple(meta['ori_shape'] for meta in img_metas)
File "C:\Users\InjectoFORTY\miniconda3\lib\site-packages\mmdet\models\roi_heads\point_rend_roi_head.py", line 162, in
ori_shapes = tuple(meta['ori_shape'] for meta in img_metas)
KeyError: 'ori_shape'
2022-04-04 18:06:58,917 - mmdeploy - ERROR - torch2onnx failed.
Process finished with exit code 1
Your help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: