Closed Geniukx closed 1 year ago
https://github.com/microsoft/onnxruntime/issues/11230#issuecomment-1100745427
10/12 04:18:01 - mmengine - INFO - Finish pipeline mmdeploy.apis.pytorch2onnx.torch2onnx 10/12 04:18:02 - mmengine - INFO - Start pipeline mmdeploy.apis.utils.utils.to_backend in main process 10/12 04:18:02 - mmengine - INFO - Finish pipeline mmdeploy.apis.utils.utils.to_backend
转换没问题
10/12 04:18:02 - mmengine - INFO - visualize onnxruntime model start. 10/12 04:18:09 - mmengine - WARNING - Failed to search registry with scope "mmpose" 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 "mmpose" is a correct scope, or whether the registry is initialized. 10/12 04:18:09 - mmengine - WARNING - Failed to search registry with scope "mmpose" in the "mmpose_tasks" registry tree. As a workaround, the current "mmpose_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmpose" is a correct scope, or whether the registry is initialized. 10/12 04:18:09 - mmengine - WARNING - Failed to search registry with scope "mmpose" in the "backend_segmentors" registry tree. As a workaround, the current "backend_segmentors" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmpose" is a correct scope, or whether the registry is initialized. The given version [15] is not supported, only version 1 to 8 is supported in this build. 10/12 04:18:15 - mmengine - ERROR - tools/deploy.py - create_process - 82 - visualize onnxruntime model failed.
可视化报错(加载转换后的模型),这个问题应该是由于加载了错误的onnxruntime的动态库,windows的话你检查下有没有这个文件,有的话删掉。
C:\windows\system32\onnxruntime.dll
microsoft/onnxruntime#11230 (comment)
10/12 04:18:01 - mmengine - INFO - Finish pipeline mmdeploy.apis.pytorch2onnx.torch2onnx 10/12 04:18:02 - mmengine - INFO - Start pipeline mmdeploy.apis.utils.utils.to_backend in main process 10/12 04:18:02 - mmengine - INFO - Finish pipeline mmdeploy.apis.utils.utils.to_backend
转换没问题
10/12 04:18:02 - mmengine - INFO - visualize onnxruntime model start. 10/12 04:18:09 - mmengine - WARNING - Failed to search registry with scope "mmpose" 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 "mmpose" is a correct scope, or whether the registry is initialized. 10/12 04:18:09 - mmengine - WARNING - Failed to search registry with scope "mmpose" in the "mmpose_tasks" registry tree. As a workaround, the current "mmpose_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmpose" is a correct scope, or whether the registry is initialized. 10/12 04:18:09 - mmengine - WARNING - Failed to search registry with scope "mmpose" in the "backend_segmentors" registry tree. As a workaround, the current "backend_segmentors" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmpose" is a correct scope, or whether the registry is initialized. The given version [15] is not supported, only version 1 to 8 is supported in this build. 10/12 04:18:15 - mmengine - ERROR - tools/deploy.py - create_process - 82 - visualize onnxruntime model failed.
可视化报错(加载转换后的模型),这个问题应该是由于加载了错误的onnxruntime的动态库,windows的话你检查下有没有这个文件,有的话删掉。
C:\windows\system32\onnxruntime.dll
您好!我已经参考其他issue或doc,将System32和SysWOW64下的onnxruntime.dll都重命名了,在cmd中输入onnxruntime.dll得到: 我感觉调用的应该就是正确的dll文件,请问这里有问题吗?
reproduce on ubuntu server 20.04:
python ./tools/deploy.py /home/qinglang/lab/mmlab/mmdeploy/configs/mmpose/pose-detection_simcc_onnxruntime_dynamic_hand.py /home/qinglang/lab/mmlab/mmpose/configs/hand_2d_keypoint/rtmpose/coco_hand/rtmpose-m_lab.py /home/qinglang/lab/internship/hand_pose_estimation/checkpoints/mmpose/best_AUC_epoch_40_published-24d6a9fb_20231011.pth /home/qinglang/lab/internship/hand_pose_estimation/datasets/lab/main_validated/images/000001.jpg --work-dir rtmpose-ort/rtmpose-m --device cuda:1 --show --dump-info
10/12 15:16:12 - mmengine - WARNING - Failed to search registry with scope "mmpose" 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 "mmpose" is a correct scope, or whether the registry is initialized.
10/12 15:16:12 - mmengine - WARNING - Failed to search registry with scope "mmpose" in the "mmpose_tasks" registry tree. As a workaround, the current "mmpose_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmpose" is a correct scope, or whether the registry is initialized.
10/12 15:16:13 - mmengine - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess
10/12 15:16:13 - mmengine - WARNING - Failed to search registry with scope "mmpose" 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 "mmpose" is a correct scope, or whether the registry is initialized.
10/12 15:16:13 - mmengine - WARNING - Failed to search registry with scope "mmpose" in the "mmpose_tasks" registry tree. As a workaround, the current "mmpose_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmpose" is a correct scope, or whether the registry is initialized.
Loads checkpoint by local backend from path: /home/qinglang/lab/internship/hand_pose_estimation/checkpoints/mmpose/best_AUC_epoch_40_published-24d6a9fb_20231011.pth
10/12 15:16:15 - mmengine - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future.
10/12 15:16:15 - mmengine - INFO - Export PyTorch model to ONNX: rtmpose-ort/rtmpose-m/end2end.onnx.
10/12 15:16:15 - mmengine - WARNING - Can not find models.yolox_pose_head.YOLOXPoseHead.predict, function rewrite will not be applied
10/12 15:16:15 - mmengine - WARNING - Can not find models.yolox_pose_head.YOLOXPoseHead.predict_by_feat, function rewrite will not be applied
10/12 15:16:16 - mmengine - INFO - Execute onnx optimize passes.
10/12 15:16:16 - mmengine - WARNING - Can not optimize model, please build torchscipt extension.
More details: https://github.com/open-mmlab/mmdeploy/tree/main/docs/en/experimental/onnx_optimizer.md
================ Diagnostic Run torch.onnx.export version 2.0.1 ================
verbose: False, log level: Level.ERROR
======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ========================
10/12 15:16:16 - mmengine - INFO - Finish pipeline mmdeploy.apis.pytorch2onnx.torch2onnx
10/12 15:16:17 - mmengine - INFO - Start pipeline mmdeploy.apis.utils.utils.to_backend in main process
10/12 15:16:17 - mmengine - INFO - Finish pipeline mmdeploy.apis.utils.utils.to_backend
10/12 15:16:17 - mmengine - INFO - visualize onnxruntime model start.
10/12 15:16:18 - mmengine - WARNING - Failed to search registry with scope "mmpose" 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 "mmpose" is a correct scope, or whether the registry is initialized.
10/12 15:16:18 - mmengine - WARNING - Failed to search registry with scope "mmpose" in the "mmpose_tasks" registry tree. As a workaround, the current "mmpose_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmpose" is a correct scope, or whether the registry is initialized.
10/12 15:16:18 - mmengine - WARNING - Failed to search registry with scope "mmpose" in the "backend_segmentors" registry tree. As a workaround, the current "backend_segmentors" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmpose" is a correct scope, or whether the registry is initialized.
The given version [15] is not supported, only version 1 to 8 is supported in this build.
10/12 15:16:18 - mmengine - ERROR - ./tools/deploy.py - create_process - 82 - visualize onnxruntime model failed.
same problem!!!!
@Geniukx @wenkaiH
可能是因为onnxruntime/onnxruntime-gpu 版本过低导致的,你们可能装的版本是1.8.x,可以通过pip list看一下。
可视化的时候 onnxruntime python wrapper 会加载自定义算子(libmmdeploy_onnxruntime_ops.so),这个自定义算子在mmdeploy-1.3.0 编译的时候用的是onnxruntime 1.15.1(1.3.0之前是1.8.1),所以onnxruntime的版本应该>=1.15.1才可以加载
(PS. mmdeploy-1.3.0 windows-sdk 貌似还是用onnxruntime 1.8.1编译的。所以如果用这个sdk的话,需要使用包里的onnxruntime)
@irexyc 感谢大佬!问题解决了!
@Geniukx @wenkaiH
可能是因为onnxruntime/onnxruntime-gpu 版本过低导致的,你们可能装的版本是1.8.x,可以通过pip list看一下。
可视化的时候 onnxruntime python wrapper 会加载自定义算子(libmmdeploy_onnxruntime_ops.so),这个自定义算子在mmdeploy-1.3.0 编译的时候用的是onnxruntime 1.15.1(1.3.0之前是1.8.1),所以onnxruntime的版本应该>=1.15.1才可以加载
(PS. mmdeploy-1.3.0 windows-sdk 貌似还是用onnxruntime 1.8.1编译的。所以如果用这个sdk的话,需要使用包里的onnxruntime)
Thanks!!!
@Geniukx @wenkaiH
可能是因为onnxruntime/onnxruntime-gpu 版本过低导致的,你们可能装的版本是1.8.x,可以通过pip list看一下。
可视化的时候 onnxruntime python wrapper 会加载自定义算子(libmmdeploy_onnxruntime_ops.so),这个自定义算子在mmdeploy-1.3.0 编译的时候用的是onnxruntime 1.15.1(1.3.0之前是1.8.1),所以onnxruntime的版本应该>=1.15.1才可以加载
(PS. mmdeploy-1.3.0 windows-sdk 貌似还是用onnxruntime 1.8.1编译的。所以如果用这个sdk的话,需要使用包里的onnxruntime)
mmdeploy tutorial 里面写的还是 1.8.1
THANKS!
@Geniukx @wenkaiH
可能是因为onnxruntime/onnxruntime-gpu 版本过低导致的,你们可能装的版本是1.8.x,可以通过pip list看一下。
可视化的时候 onnxruntime python wrapper 会加载自定义算子(libmmdeploy_onnxruntime_ops.so),这个自定义算子在mmdeploy-1.3.0 编译的时候用的是onnxruntime 1.15.1(1.3.0之前是1.8.1),所以onnxruntime的版本应该>=1.15.1才可以加载
(PS. mmdeploy-1.3.0 windows-sdk 貌似还是用onnxruntime 1.8.1编译的。所以如果用这个sdk的话,需要使用包里的onnxruntime)
@Geniukx @wenkaiH
可能是因为onnxruntime/onnxruntime-gpu 版本过低导致的,你们可能装的版本是1.8.x,可以通过pip list看一下。
可视化的时候 onnxruntime python wrapper 会加载自定义算子(libmmdeploy_onnxruntime_ops.so),这个自定义算子在mmdeploy-1.3.0 编译的时候用的是onnxruntime 1.15.1(1.3.0之前是1.8.1),所以onnxruntime的版本应该>=1.15.1才可以加载
(PS. mmdeploy-1.3.0 windows-sdk 貌似还是用onnxruntime 1.8.1编译的。所以如果用这个sdk的话,需要使用包里的onnxruntime)
那官方的教程没更新啊,他推荐的mmdeploy-1.3.1,对应的还是onnxruntime 1.8.1,这是个坑。
Checklist
Describe the bug
The message The given version [15] is not supported, only version 1 to 8 is supported in this build shows when I run the script tools/deploy.py and tools/profiler.py, and exit with no more message. So I speculate that where is something wrong with the inference progress. The origin pytorch model is based on rtmpose-m(alias as hand in mmpose), I modify the input size of
pose-detection_simcc_onnxruntime_dynamic.py
to (256, 256) as the deploy config.I have already follow some guides that rename the onnxruntime.dll in System32 and SysWoW64, and I can confirm that the onnxruntime.dll I use is the one from onnxruntime-win-gpu-x64-1.8.1
Reproduction
The script I run:
Besides, I modify the
ctypes.DLL(lib_path)
toctypes.WinDLL(lib_path)
inD:\Development\MiniConda\envs\mmlab\Lib\site-packages\mmdeploy\backend\onnxruntime\wrapper.py
for the Errormmpose attributeerror: module 'ctypes' has no attribute 'dll'
, and the Error disappeared with the occurrence of the message I mentioned above instead.Environment
Error traceback
And when I use a script to infer: