(mmdeploy) C:\Users\DELL\Desktop\convert>python C:\Users\DELL\Desktop\convert\icp_mmdeploy\tools\deploy.py C:\Users\DELL\Desktop\convert\mmyolo_deploy\configs\deploy\detection_tensorrt_static-640x640.py C:\Users\DELL\Desktop\convert\mmyolo_deploy\configs\deploy\model\yolov5_s-static.py C:\Users\DELL\Desktop\convert\mmyolo_deploy\epoch_120.pth C:\Users\DELL\Desktop\convert\mmyolo_deploy\dcis_inseg_1504.jpg --work-dir C:/Users/DELL/Desktop/convert/OUTPUT_yolov5_test_insseg --show --device cuda --dump-info
07/22 16:29:51 - mmengine - WARNING - Import mmdeploy.codebase.mmyolo.deploy failedPlease check whether the module is the custom module.No module named 'mmdeploy.codebase.mmyolo'
07/22 16:29:51 - mmengine - WARNING - Failed to search registry with scope "mmyolo" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmyolo" is a correct scope, or whether the registry is initialized.
07/22 16:29:53 - mmengine - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess
07/22 16:29:54 - mmengine - WARNING - Import mmdeploy.codebase.mmyolo.deploy failedPlease check whether the module is the custom module.No module named 'mmdeploy.codebase.mmyolo'
07/22 16:29:54 - mmengine - WARNING - Failed to search registry with scope "mmyolo" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmyolo" is a correct scope, or whether the registry is initialized.
!!!You are using YOLOv5Head with num_classes == 1. The loss_cls will be 0. This is a normal phenomenon.
Loads checkpoint by local backend from path: C:\Users\DELL\Desktop\convert\mmyolo_deploy\epoch_120.pth
Switch model to deploy modality.
07/22 16:29:55 - mmengine - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future.
07/22 16:29:55 - mmengine - INFO - Export PyTorch model to ONNX: C:/Users/DELL/Desktop/convert/OUTPUT_yolov5_test_insseg\end2end.onnx.
07/22 16:29:55 - mmengine - WARNING - Can not find torch.nn.functional._scaled_dot_product_attention, function rewrite will not be applied
07/22 16:29:55 - mmengine - WARNING - Can not find mmdet.models.utils.transformer.PatchMerging.forward, function rewrite will not be applied
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\codebase\mmdet\models\detectors\single_stage.py:80: TracerWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).
img_shape = [int(val) for val in img_shape]
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\codebase\mmdet\models\detectors\single_stage.py:80: 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!
img_shape = [int(val) for val in img_shape]
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\core\optimizers\function_marker.py:160: 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)
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmyolo\models\task_modules\coders\yolov5_bbox_coder.py:35: 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) == priors.size(-1) == 4
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmyolo\models\dense_heads\yolov5_ins_head.py:561: TracerWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).
img_meta) in zip(flatten_decoded_bboxes, flatten_cls_scores,
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmyolo\models\dense_heads\yolov5_ins_head.py:594: 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 scores.shape[0] == 0:
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdet\models\utils\misc.py:336: 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!
num_topk = min(topk, valid_idxs.size(0))
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmengine\structures\instance_data.py:308: TracerWarning: Using len to get tensor shape might cause the trace to be incorrect. Recommended usage would be tensor.shape[0]. Passing a tensor of different shape might lead to errors or silently give incorrect results.
return len(self.values()[0])
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmengine\structures\instance_data.py:154: TracerWarning: Using len to get tensor shape might cause the trace to be incorrect. Recommended usage would be tensor.shape[0]. Passing a tensor of different shape might lead to errors or silently give incorrect results.
assert len(value) == len(self), 'The length of '
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdet\models\dense_heads\base_dense_head.py:479: 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 valid_mask.all():
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdet\models\dense_heads\base_dense_head.py:483: 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 with_nms and results.bboxes.numel() > 0:
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:276: 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 boxes.size(-1) == 5:
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:293: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.
max_coordinate + torch.tensor(1).to(boxes))
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:302: 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 boxes_for_nms.shape[0] < split_thr:
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:317: TracerWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).
for id in torch.unique(idxs):
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:123: 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 boxes.size(1) == 4
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:124: 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 boxes.size(0) == scores.size(0)
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmyolo\models\dense_heads\yolov5_ins_head.py:638: TracerWarning: Using len to get tensor shape might cause the trace to be incorrect. Recommended usage would be tensor.shape[0]. Passing a tensor of different shape might lead to errors or silently give incorrect results.
if len(results.bboxes):
================ Diagnostic Run torch.onnx.export version 2.0.1 ================
verbose: False, log level: Level.ERROR
======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ========================
Process Process-2:
Traceback (most recent call last):
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py", line 107, in call
ret = func(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\pytorch2onnx.py", line 98, in torch2onnx
export(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py", line 356, in wrap
return self.call_function(func_name, *args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py", line 326, in call_function
return self.call_function_local(func_name, *args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py", line 275, in call_function_local
return pipe_caller(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py", line 107, in call
ret = func(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\onnx\export.py", line 138, in export
torch.onnx.export(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\onnx\utils.py", line 506, in export
_export(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\onnx\utils.py", line 1548, in _export
graph, params_dict, torch_out = _model_to_graph(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\onnx\optimizer.py", line 27, in model_to_graph__custom_optimizer
graph, params_dict, torch_out = ctx.origin_func(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\onnx\utils.py", line 1113, in _model_to_graph
graph, params, torch_out, module = _create_jit_graph(model, args)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\onnx\utils.py", line 989, in _create_jit_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\onnx\utils.py", line 893, in _trace_and_get_graph_from_model
trace_graph, torch_out, inputs_states = torch.jit._get_trace_graph(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\jit_trace.py", line 1268, in _get_trace_graph
outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\jit_trace.py", line 127, in forward
graph, out = torch._C._create_graph_by_tracing(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\jit_trace.py", line 118, in wrapper
outs.append(self.inner(*trace_inputs))
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\nn\modules\module.py", line 1488, in _slow_forward
result = self.forward(*input, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\onnx\export.py", line 123, in wrapper
return forward(*arg, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\codebase\mmdet\models\detectors\single_stage.py", line 85, in single_stage_detector__forward
return __forward_impl(self, batch_inputs, data_samples=data_samples)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\core\optimizers\function_marker.py", line 266, in g
rets = f(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\codebase\mmdet\models\detectors\single_stage.py", line 23, in __forward_impl
output = self.bbox_head.predict(x, data_samples, rescale=False)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdet\models\dense_heads\base_dense_head.py", line 197, in predict
predictions = self.predict_by_feat(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmyolo\models\dense_heads\yolov5_ins_head.py", line 681, in predict_by_feat
results.masks = masks.bool()
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmengine\structures\instance_data.py", line 154, in setattr
assert len(value) == len(self), 'The length of '
AssertionError: The length of values 1 is not consistent with the length of this :obj:InstanceData 300
07/22 16:29:58 - mmengine - ERROR - C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py - pop_mp_output - 80 - mmdeploy.apis.pytorch2onnx.torch2onnx with Call id: 0 failed. exit.
(mmdeploy) C:\Users\DELL\Desktop\convert>python C:\Users\DELL\Desktop\convert\icp_mmdeploy\tools\deploy.py C:\Users\DELL\Desktop\convert\mmyolo_deploy\configs\deploy\detection_tensorrt_static-640x640.py C:\Users\DELL\Desktop\convert\mmyolo_deploy\configs\deploy\model\yolov5_s-static.py C:\Users\DELL\Desktop\convert\mmyolo_deploy\epoch_120.pth C:\Users\DELL\Desktop\convert\mmyolo_deploy\dcis_inseg_1504.jpg --work-dir C:/Users/DELL/Desktop/convert/OUTPUT_yolov5_test_insseg --show --device cuda --dump-info
07/22 16:29:51 - mmengine - WARNING - Import mmdeploy.codebase.mmyolo.deploy failedPlease check whether the module is the custom module.No module named 'mmdeploy.codebase.mmyolo'
07/22 16:29:51 - mmengine - WARNING - Failed to search registry with scope "mmyolo" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmyolo" is a correct scope, or whether the registry is initialized.
07/22 16:29:53 - mmengine - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess
07/22 16:29:54 - mmengine - WARNING - Import mmdeploy.codebase.mmyolo.deploy failedPlease check whether the module is the custom module.No module named 'mmdeploy.codebase.mmyolo'
07/22 16:29:54 - mmengine - WARNING - Failed to search registry with scope "mmyolo" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmyolo" is a correct scope, or whether the registry is initialized.
!!!You are using
YOLOv5Headwith num_classes == 1. The loss_cls will be 0. This is a normal phenomenon.Loads checkpoint by local backend from path: C:\Users\DELL\Desktop\convert\mmyolo_deploy\epoch_120.pth
Switch model to deploy modality.
07/22 16:29:55 - mmengine - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future.
07/22 16:29:55 - mmengine - INFO - Export PyTorch model to ONNX: C:/Users/DELL/Desktop/convert/OUTPUT_yolov5_test_insseg\end2end.onnx.
07/22 16:29:55 - mmengine - WARNING - Can not find torch.nn.functional._scaled_dot_product_attention, function rewrite will not be applied
07/22 16:29:55 - mmengine - WARNING - Can not find mmdet.models.utils.transformer.PatchMerging.forward, function rewrite will not be applied
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\codebase\mmdet\models\detectors\single_stage.py:80: TracerWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).
img_shape = [int(val) for val in img_shape]
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\codebase\mmdet\models\detectors\single_stage.py:80: 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!
img_shape = [int(val) for val in img_shape]
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\core\optimizers\function_marker.py:160: 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)
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmyolo\models\task_modules\coders\yolov5_bbox_coder.py:35: 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) == priors.size(-1) == 4
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmyolo\models\dense_heads\yolov5_ins_head.py:561: TracerWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).
img_meta) in zip(flatten_decoded_bboxes, flatten_cls_scores,
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmyolo\models\dense_heads\yolov5_ins_head.py:594: 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 scores.shape[0] == 0:
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdet\models\utils\misc.py:336: 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!
num_topk = min(topk, valid_idxs.size(0))
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmengine\structures\instance_data.py:308: TracerWarning: Using len to get tensor shape might cause the trace to be incorrect. Recommended usage would be tensor.shape[0]. Passing a tensor of different shape might lead to errors or silently give incorrect results.
return len(self.values()[0])
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmengine\structures\instance_data.py:154: TracerWarning: Using len to get tensor shape might cause the trace to be incorrect. Recommended usage would be tensor.shape[0]. Passing a tensor of different shape might lead to errors or silently give incorrect results.
assert len(value) == len(self), 'The length of '
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdet\models\dense_heads\base_dense_head.py:479: 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 valid_mask.all():
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdet\models\dense_heads\base_dense_head.py:483: 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 with_nms and results.bboxes.numel() > 0:
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:276: 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 boxes.size(-1) == 5:
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:293: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.
max_coordinate + torch.tensor(1).to(boxes))
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:302: 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 boxes_for_nms.shape[0] < split_thr:
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:317: TracerWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).
for id in torch.unique(idxs):
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:123: 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 boxes.size(1) == 4
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmcv\ops\nms.py:124: 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 boxes.size(0) == scores.size(0)
C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmyolo\models\dense_heads\yolov5_ins_head.py:638: TracerWarning: Using len to get tensor shape might cause the trace to be incorrect. Recommended usage would be tensor.shape[0]. Passing a tensor of different shape might lead to errors or silently give incorrect results.
if len(results.bboxes):
================ Diagnostic Run torch.onnx.export version 2.0.1 ================
verbose: False, log level: Level.ERROR
======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ========================
Process Process-2:
Traceback (most recent call last):
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py", line 107, in call
ret = func(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\pytorch2onnx.py", line 98, in torch2onnx
export(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py", line 356, in wrap
return self.call_function(func_name, *args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py", line 326, in call_function
return self.call_function_local(func_name, *args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py", line 275, in call_function_local
return pipe_caller(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py", line 107, in call
ret = func(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\onnx\export.py", line 138, in export
torch.onnx.export(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\onnx\utils.py", line 506, in export
_export(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\onnx\utils.py", line 1548, in _export
graph, params_dict, torch_out = _model_to_graph(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\onnx\optimizer.py", line 27, in model_to_graph__custom_optimizer
graph, params_dict, torch_out = ctx.origin_func(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\onnx\utils.py", line 1113, in _model_to_graph
graph, params, torch_out, module = _create_jit_graph(model, args)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\onnx\utils.py", line 989, in _create_jit_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\onnx\utils.py", line 893, in _trace_and_get_graph_from_model
trace_graph, torch_out, inputs_states = torch.jit._get_trace_graph(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\jit_trace.py", line 1268, in _get_trace_graph
outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\jit_trace.py", line 127, in forward
graph, out = torch._C._create_graph_by_tracing(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\jit_trace.py", line 118, in wrapper
outs.append(self.inner(*trace_inputs))
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\torch\nn\modules\module.py", line 1488, in _slow_forward
result = self.forward(*input, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\onnx\export.py", line 123, in wrapper
return forward(*arg, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\codebase\mmdet\models\detectors\single_stage.py", line 85, in single_stage_detector__forward
return __forward_impl(self, batch_inputs, data_samples=data_samples)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\core\optimizers\function_marker.py", line 266, in g
rets = f(*args, **kwargs)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\codebase\mmdet\models\detectors\single_stage.py", line 23, in __forward_impl
output = self.bbox_head.predict(x, data_samples, rescale=False)
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdet\models\dense_heads\base_dense_head.py", line 197, in predict
predictions = self.predict_by_feat(
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmyolo\models\dense_heads\yolov5_ins_head.py", line 681, in predict_by_feat
results.masks = masks.bool()
File "C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmengine\structures\instance_data.py", line 154, in setattr
assert len(value) == len(self), 'The length of '
AssertionError: The length of values 1 is not consistent with the length of this :obj:
InstanceData30007/22 16:29:58 - mmengine - ERROR - C:\Users\DELL\anaconda3\envs\mmdeploy\lib\site-packages\mmdeploy\apis\core\pipeline_manager.py - pop_mp_output - 80 -
mmdeploy.apis.pytorch2onnx.torch2onnxwith Call id: 0 failed. exit.