Skip to content
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

[Bug] mmdetection rtmdet 转 tensorrt 或者 onnx 报错 #1633

Open
3 tasks done
1095788063 opened this issue Jan 10, 2023 · 11 comments
Open
3 tasks done

[Bug] mmdetection rtmdet 转 tensorrt 或者 onnx 报错 #1633

1095788063 opened this issue Jan 10, 2023 · 11 comments
Assignees

Comments

@1095788063
Copy link

Checklist

  • I have searched related issues but cannot get the expected help.
  • 2. I have read the FAQ documentation but cannot get the expected help.
  • 3. The bug has not been fixed in the latest version.

Describe the bug

mmdetection rtmdet 转 tensorrt 或者 onnx 报错

RuntimeError: Only tuples, lists and Variables are supported as JIT inputs/outputs. Dictionaries and strings are also accepted, but their usage is not recommended. Here, received an input of unsupported type: InstanceData
01/10 19:45:40 - mmengine - ERROR - D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\apis\core\pipeline_manager.py - pop_mp_output - 80 - mmdeploy.apis.pytorch2onnx.torch2onnx with Call id: 0 failed. exit.

Reproduction

D:\Python\Python38\python.exe D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\tools\deploy.py --deploy_cfg configs/mmdet/instance-seg/instance-seg_tensorrt_static-448x448.py --model_cfg rtmdet-ins_s_8xb32-300e_coco.py --checkpoint epoch_82.pth

Environment

D:\Python\Python38\python.exe D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\tools\check_env.py 
01/10 19:48:56 - mmengine - INFO - 

01/10 19:48:56 - mmengine - INFO - **********Environmental information**********
01/10 19:49:00 - mmengine - INFO - sys.platform: win32
01/10 19:49:00 - mmengine - INFO - Python: 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
01/10 19:49:00 - mmengine - INFO - CUDA available: True
01/10 19:49:00 - mmengine - INFO - numpy_random_seed: 2147483648
01/10 19:49:00 - mmengine - INFO - GPU 0: NVIDIA GeForce RTX 3070
01/10 19:49:00 - mmengine - INFO - CUDA_HOME: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3
01/10 19:49:00 - mmengine - INFO - NVCC: Cuda compilation tools, release 11.3, V11.3.58
01/10 19:49:00 - mmengine - INFO - MSVC: 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.29.30147 版
01/10 19:49:00 - mmengine - INFO - GCC: n/a
01/10 19:49:00 - mmengine - INFO - PyTorch: 1.10.0+cu113
01/10 19:49:00 - mmengine - INFO - PyTorch compiling details: PyTorch built with:
  - C++ Version: 199711
  - MSVC 192829337
  - Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  - OpenMP 2019
  - LAPACK is enabled (usually provided by MKL)
  - CPU capability usage: AVX2
  - CUDA Runtime 11.3
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_37,code=compute_37
  - CuDNN 8.2
  - Magma 2.5.4
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.0, CXX_COMPILER=C:/w/b/windows/tmp_bin/sccache-cl.exe, CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IC:/w/b/windows/mkl/include -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.10.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON, 

01/10 19:49:00 - mmengine - INFO - TorchVision: 0.11.0+cu113
01/10 19:49:00 - mmengine - INFO - OpenCV: 4.5.5
01/10 19:49:00 - mmengine - INFO - MMEngine: 0.4.0
01/10 19:49:00 - mmengine - INFO - MMCV: 2.0.0rc3
01/10 19:49:00 - mmengine - INFO - MMCV Compiler: MSVC 192829924
01/10 19:49:00 - mmengine - INFO - MMCV CUDA Compiler: 11.3
01/10 19:49:00 - mmengine - INFO - MMDeploy: 1.0.0rc1+
01/10 19:49:00 - mmengine - INFO - 

01/10 19:49:00 - mmengine - INFO - **********Backend information**********
01/10 19:49:00 - mmengine - INFO - tensorrt:	8.2.5.1
01/10 19:49:00 - mmengine - INFO - tensorrt custom ops:	Available
01/10 19:49:01 - mmengine - INFO - ONNXRuntime:	1.8.1
01/10 19:49:01 - mmengine - INFO - ONNXRuntime-gpu:	None
01/10 19:49:01 - mmengine - INFO - ONNXRuntime custom ops:	NotAvailable
01/10 19:49:01 - mmengine - INFO - pplnn:	None
01/10 19:49:01 - mmengine - INFO - ncnn:	None
01/10 19:49:01 - mmengine - INFO - snpe:	None
01/10 19:49:01 - mmengine - INFO - openvino:	None
01/10 19:49:01 - mmengine - INFO - torchscript:	1.10.0+cu113
01/10 19:49:01 - mmengine - INFO - torchscript custom ops:	NotAvailable
01/10 19:49:01 - mmengine - INFO - rknn-toolkit:	None
01/10 19:49:01 - mmengine - INFO - rknn2-toolkit:	None
01/10 19:49:01 - mmengine - INFO - ascend:	None
01/10 19:49:01 - mmengine - INFO - coreml:	None
01/10 19:49:01 - mmengine - INFO - tvm:	None
01/10 19:49:01 - mmengine - INFO - 

01/10 19:49:01 - mmengine - INFO - **********Codebase information**********
01/10 19:49:01 - mmengine - INFO - mmdet:	3.0.0rc5
01/10 19:49:01 - mmengine - INFO - mmseg:	None
01/10 19:49:01 - mmengine - INFO - mmcls:	None
01/10 19:49:01 - mmengine - INFO - mmocr:	None
01/10 19:49:01 - mmengine - INFO - mmedit:	None
01/10 19:49:01 - mmengine - INFO - mmdet3d:	None
01/10 19:49:01 - mmengine - INFO - mmpose:	None
01/10 19:49:01 - mmengine - INFO - mmrotate:	None
01/10 19:49:01 - mmengine - INFO - mmaction:	None

进程已结束,退出代码0

Error traceback

No response

@mm-assistant
Copy link

mm-assistant bot commented Jan 10, 2023

We recommend using English or English & Chinese for issues so that we could have broader discussion.

@1095788063
Copy link
Author

image

@1095788063
Copy link
Author

D:\Python\Python38\python.exe D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\tools\deploy.py
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "mmdet_tasks" registry tree. As a workaround, the current "mmdet_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "mmdet_tasks" registry tree. As a workaround, the current "mmdet_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "mmdet_tasks" registry tree. As a workaround, the current "mmdet_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "mmdet_tasks" registry tree. As a workaround, the current "mmdet_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "mmdet_tasks" registry tree. As a workaround, the current "mmdet_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:22 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:24 - mmengine - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess
01/10 19:49:25 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:25 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "mmdet_tasks" registry tree. As a workaround, the current "mmdet_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:25 - mmengine - WARNING - Failed to search registry with scope "mmdet" 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 "mmdet" is a correct scope, or whether the registry is initialized.
01/10 19:49:25 - mmengine - WARNING - The "model" registry in mmdet did not set import location. Fallback to call mmdet.utils.register_all_modules instead.
01/10 19:49:26 - mmengine - WARNING - The "task util" registry in mmdet did not set import location. Fallback to call mmdet.utils.register_all_modules instead.
Loads checkpoint by local backend from path: D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdetection\mmdetection-V3.0.0rc5_dev_2023-01-09\runs\train\rtmdet-ins_s_8xb32-300e_coco_4CH\epoch_82.pth
01/10 19:49:26 - mmengine - WARNING - The "transform" registry in mmdet did not set import location. Fallback to call mmdet.utils.register_all_modules instead.
01/10 19:49:27 - mmengine - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future.
01/10 19:49:27 - mmengine - INFO - Export PyTorch model to ONNX: D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdetection\mmdetection-V3.0.0rc5_dev_2023-01-09\runs\train\rtmdet-ins_s_8xb32-300e_coco_4CH\fp32\end2end.onnx.
01/10 19:49:27 - mmengine - WARNING - Can not find torch._C._jit_pass_onnx_autograd_function_process, function rewrite will not be applied
01/10 19:49:27 - mmengine - WARNING - Can not find torch._C._jit_pass_onnx_deduplicate_initializers, function rewrite will not be applied
01/10 19:49:27 - mmengine - WARNING - Can not find mmdet.models.utils.transformer.PatchMerging.forward, function rewrite will not be applied
D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\codebase\mmdet\models\detectors\single_stage.py:84: 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]
D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\codebase\mmdet\models\detectors\single_stage.py:84: 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]
D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\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)
d:\ayjdata\code\deep_learning\openmmlab\mmdetection\mmdetection-v3.0.0rc5_dev_2023-01-09\mmdet\models\necks\cspnext_pafpn.py:151: 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 upsample_feat.shape != feat_low.shape:
D:\Python\Python38\lib\site-packages\torch\nn\functional.py:3631: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
warnings.warn(
D:\Python\Python38\lib\site-packages\torch\functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ..\aten\src\ATen\native\TensorShape.cpp:2157.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
d:\ayjdata\code\deep_learning\openmmlab\mmdetection\mmdetection-v3.0.0rc5_dev_2023-01-09\mmdet\models\dense_heads\rtmdet_ins_head.py:353: 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:]
d:\ayjdata\code\deep_learning\openmmlab\mmdetection\mmdetection-v3.0.0rc5_dev_2023-01-09\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))
D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\codebase\mmdet\models\task_modules\coders\distance_point_bbox_coder.py:34: 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 points.size(0) == pred_bboxes.size(0)
D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\codebase\mmdet\models\task_modules\coders\distance_point_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 points.size(-1) == 2
D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\codebase\mmdet\models\task_modules\coders\distance_point_bbox_coder.py:36: 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) == 4
d:\ayjdata\code\deep_learning\openmmlab\mmengine-main\mmengine-main_v0.4.0-2023-01-09\mmengine\structures\instance_data.py:296: 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])
d:\ayjdata\code\deep_learning\openmmlab\mmengine-main\mmengine-main_v0.4.0-2023-01-09\mmengine\structures\instance_data.py:139: 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 '
d:\ayjdata\code\deep_learning\openmmlab\mmdetection\mmdetection-v3.0.0rc5_dev_2023-01-09\mmdet\models\dense_heads\rtmdet_ins_head.py:478: 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():
D:\Python\Python38\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:
D:\Python\Python38\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))
D:\Python\Python38\lib\site-packages\mmcv\ops\nms.py:301: 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:
D:\Python\Python38\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
D:\Python\Python38\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)
d:\ayjdata\code\deep_learning\openmmlab\mmdetection\mmdetection-v3.0.0rc5_dev_2023-01-09\mmdet\models\dense_heads\rtmdet_ins_head.py:559: 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 num_inst < 1:
Process Process-2:
Traceback (most recent call last):
File "D:\Python\Python38\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "D:\Python\Python38\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self.kwargs)
File "D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\apis\core\pipeline_manager.py", line 107, in call
ret = func(*args, **kwargs)
File "D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\apis\pytorch2onnx.py", line 98, in torch2onnx
export(
File "D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\apis\core\pipeline_manager.py", line 356, in wrap
return self.call_function(func_name
, *args, **kwargs)
File "D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\apis\core\pipeline_manager.py", line 326, in call_function
return self.call_function_local(func_name, *args, **kwargs)
File "D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\apis\core\pipeline_manager.py", line 275, in call_function_local
return pipe_caller(*args, **kwargs)
File "D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\apis\core\pipeline_manager.py", line 107, in call
ret = func(*args, **kwargs)
File "D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\apis\onnx\export.py", line 131, in export
torch.onnx.export(
File "D:\Python\Python38\lib\site-packages\torch\onnx_init
.py", line 316, in export
return utils.export(model, args, f, export_params, verbose, training,
File "D:\Python\Python38\lib\site-packages\torch\onnx\utils.py", line 107, in export
_export(model, args, f, export_params, verbose, training, input_names, output_names,
File "D:\Python\Python38\lib\site-packages\torch\onnx\utils.py", line 724, in _export
_model_to_graph(model, args, verbose, input_names,
File "D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\apis\onnx\optimizer.py", line 11, in model_to_graph__custom_optimizer
graph, params_dict, torch_out = ctx.origin_func(*args, **kwargs)
File "D:\Python\Python38\lib\site-packages\torch\onnx\utils.py", line 493, in _model_to_graph
graph, params, torch_out, module = _create_jit_graph(model, args)
File "D:\Python\Python38\lib\site-packages\torch\onnx\utils.py", line 437, in _create_jit_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args)
File "D:\Python\Python38\lib\site-packages\torch\onnx\utils.py", line 388, in _trace_and_get_graph_from_model
torch.jit._get_trace_graph(model, args, strict=False, _force_outplace=False, _return_inputs_states=True)
File "D:\Python\Python38\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 "D:\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "D:\Python\Python38\lib\site-packages\torch\jit_trace.py", line 127, in forward
graph, out = torch._C._create_graph_by_tracing(
File "D:\Python\Python38\lib\site-packages\torch\jit_trace.py", line 121, in wrapper
out_vars, _ = _flatten(outs)
RuntimeError: Only tuples, lists and Variables are supported as JIT inputs/outputs. Dictionaries and strings are also accepted, but their usage is not recommended. Here, received an input of unsupported type: InstanceData
01/10 19:49:31 - mmengine - ERROR - D:\ayjdata\Code\Deep_learning\OpenMMLab\mmdeploy\mmdeploy-dev-V1.0.0rc1-V20230105\mmdeploy\apis\core\pipeline_manager.py - pop_mp_output - 80 - mmdeploy.apis.pytorch2onnx.torch2onnx with Call id: 0 failed. exit.

进程已结束,退出代码1

@lvhan028
Copy link
Collaborator

Hi, @RangiLyu How is rtmdet-ins deployment going?

@lvhan028
Copy link
Collaborator

rtmdet-ins is not ready yet.

@zylo117
Copy link

zylo117 commented Jan 11, 2023

一样的错误,坐等白嫖rtmdet-ins的deploy

@RangiLyu
Copy link
Member

Try this #1662

@1095788063
Copy link
Author

单独做一个分支吗?

@lvhan028
Copy link
Collaborator

lvhan028 commented Mar 6, 2023

单独做一个分支吗?

It has been merged into dev-1.x

@azuryl
Copy link

azuryl commented Jul 11, 2023

I meet the same issue

@jianbohuang
Copy link

how to add unsupported type InstanceData for a SingleStageDetector?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants