2022-07-20 15:04:15,006 - mmdeploy - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess
/home/cx/ws/mmdetection/mmdet/models/dense_heads/anchor_head.py:116: UserWarning: DeprecationWarning: `num_anchors` is deprecated, for consistency or also use `num_base_priors` instead
warnings.warn('DeprecationWarning: `num_anchors` is deprecated, '
load checkpoint from local path: /data/test/latest.pth
2022-07-20 15:04:18,151 - mmdeploy - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future.
2022-07-20 15:04:18,152 - mmdeploy - INFO - Export PyTorch model to ONNX: trt/end2end.onnx.
/home/cx/ws/mmdeploy/mmdeploy/core/optimizers/function_marker.py:158: TracerWarning: Converting a tensor to a Python integer 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!
ys_shape = tuple(int(s) for s in ys.shape)
/home/cx/ws/mmdetection/mmdet/models/dense_heads/anchor_head.py:123: UserWarning: DeprecationWarning: anchor_generator is deprecated, please use "prior_generator" instead
warnings.warn('DeprecationWarning: anchor_generator is deprecated, '
/home/cx/ws/mmdetection/mmdet/core/anchor/anchor_generator.py:333: UserWarning: ``grid_anchors`` would be deprecated soon. Please use ``grid_priors``
warnings.warn('``grid_anchors`` would be deprecated soon. '
/home/cx/ws/mmdetection/mmdet/core/anchor/anchor_generator.py:369: UserWarning: ``single_level_grid_anchors`` would be deprecated soon. Please use ``single_level_grid_priors``
warnings.warn(
/home/cx/ws/mmdeploy/mmdeploy/codebase/mmrotate/models/dense_heads/oriented_rpn_head.py:79: 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!
assert cls_score.size()[-2:] == bbox_pred.size()[-2:]
/home/cx/ws/mmdeploy/mmdeploy/pytorch/functions/topk.py:56: 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 k > size:
/home/cx/ws/mmrotate/mmrotate/core/bbox/coder/delta_midpointoffset_rbbox_coder.py:78: 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!
assert pred_bboxes.size(0) == bboxes.size(0)
/home/cx/ws/mmrotate/mmrotate/core/bbox/coder/delta_midpointoffset_rbbox_coder.py:79: 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!
assert bboxes.size(-1) == 4
/home/cx/ws/mmrotate/mmrotate/core/bbox/coder/delta_midpointoffset_rbbox_coder.py:80: 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!
assert pred_bboxes.size(-1) == 6
/home/cx/ws/mmrotate/mmrotate/core/bbox/transforms.py:675: 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 N == 0:
/home/cx/ws/mmrotate/mmrotate/core/bbox/transforms.py:456: 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 N == 0:
Process Process-2:
Traceback (most recent call last):
File "/home/cx/miniconda3/envs/mm/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/cx/miniconda3/envs/mm/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 107, in __call__
ret = func(*args, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/apis/pytorch2onnx.py", line 92, in torch2onnx
export(
File "/home/cx/ws/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 356, in _wrap
return self.call_function(func_name_, *args, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 326, in call_function
return self.call_function_local(func_name, *args, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 275, in call_function_local
return pipe_caller(*args, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 107, in __call__
ret = func(*args, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/apis/onnx/export.py", line 122, in export
torch.onnx.export(
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/onnx/__init__.py", line 271, in export
return utils.export(model, args, f, export_params, verbose, training,
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/onnx/utils.py", line 88, in export
_export(model, args, f, export_params, verbose, training, input_names, output_names,
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/onnx/utils.py", line 691, in _export
_model_to_graph(model, args, verbose, input_names,
File "/home/cx/ws/mmdeploy/mmdeploy/core/rewriters/rewriter_utils.py", line 371, in wrapper
return self.func(self, *args, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/apis/onnx/optimizer.py", line 10, in model_to_graph__custom_optimizer
graph, params_dict, torch_out = ctx.origin_func(*args, **kwargs)
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/onnx/utils.py", line 454, in _model_to_graph
graph, params, torch_out, module = _create_jit_graph(model, args,
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/onnx/utils.py", line 417, in _create_jit_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args)
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/onnx/utils.py", line 377, in _trace_and_get_graph_from_model
torch.jit._get_trace_graph(model, args, strict=False, _force_outplace=False, _return_inputs_states=True)
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/jit/_trace.py", line 1139, in _get_trace_graph
outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/jit/_trace.py", line 125, in forward
graph, out = torch._C._create_graph_by_tracing(
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/jit/_trace.py", line 116, in wrapper
outs.append(self.inner(*trace_inputs))
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 887, in _call_impl
result = self._slow_forward(*input, **kwargs)
File "/home/cx/miniconda3/envs/mm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 860, in _slow_forward
result = self.forward(*input, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/core/rewriters/rewriter_utils.py", line 371, in wrapper
return self.func(self, *args, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/codebase/mmdet/models/detectors/base.py", line 70, in base_detector__forward
return __forward_impl(ctx, self, img, img_metas=img_metas, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/core/optimizers/function_marker.py", line 261, in g
rets = f(*args, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/codebase/mmdet/models/detectors/base.py", line 26, in __forward_impl
return self.simple_test(img, img_metas, **kwargs)
File "/home/cx/ws/mmrotate/mmrotate/models/detectors/two_stage.py", line 179, in simple_test
proposal_list = self.rpn_head.simple_test_rpn(x, img_metas)
File "/home/cx/ws/mmdetection/mmdet/models/dense_heads/dense_test_mixins.py", line 130, in simple_test_rpn
proposal_list = self.get_bboxes(*rpn_outs, img_metas=img_metas)
File "/home/cx/ws/mmdeploy/mmdeploy/core/rewriters/rewriter_utils.py", line 371, in wrapper
return self.func(self, *args, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/codebase/mmrotate/models/dense_heads/oriented_rpn_head.py", line 135, in oriented_rpn_head__get_bboxes
return fake_multiclass_nms_rotated(
File "/home/cx/ws/mmdeploy/mmdeploy/core/optimizers/function_marker.py", line 261, in g
rets = f(*args, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/codebase/mmrotate/core/post_processing/bbox_nms.py", line 228, in fake_multiclass_nms_rotated
return mmdeploy.codebase.mmrotate.core.post_processing.bbox_nms.\
File "/home/cx/ws/mmdeploy/mmdeploy/core/rewriters/rewriter_utils.py", line 371, in wrapper
return self.func(self, *args, **kwargs)
File "/home/cx/ws/mmdeploy/mmdeploy/codebase/mmrotate/core/post_processing/bbox_nms.py", line 269, in _fake_multiclass_nms_rotated__tensorrt
hboxes = obb2xyxy(boxes, version)
File "/home/cx/ws/mmrotate/mmrotate/core/bbox/transforms.py", line 213, in obb2xyxy
results = obb2xyxy_le135(rbboxes)
File "/home/cx/ws/mmrotate/mmrotate/core/bbox/transforms.py", line 677, in obb2xyxy_le135
polys = obb2poly_le135(rotatex_boxes)
File "/home/cx/ws/mmrotate/mmrotate/core/bbox/transforms.py", line 463, in obb2poly_le135
rects = torch.stack([tl_x, br_x, br_x, tl_x, tl_y, tl_y, br_y, br_y],
RuntimeError: shape '[2, 4, 1]' is invalid for input of size 40