Closed magic-hya closed 1 year ago
@magic-hya hi, scnet is not supported according to this: https://mmdeploy.readthedocs.io/en/latest/04-supported-codebases/mmdet.html#supported-models
@RunningLeon hi,After selecting the supported model, the conversion was successful.But when reasoning, the kernel crashes directly, and I have tried several models, all of which are the same problem.
code: from mmdeploy_runtime import Detector img_path = '/data/mmdet/mmdetection/demo/demo.jpg' img = cv2.imread(img_path) detector = Detector(model_path='/data/mmdet/onnx-faster-rcnn', device_name='cuda', device_id=0)
log: [2023-05-30 06:42:37.520] [mmdeploy] [info] [model.cpp:35] [DirectoryModel] Load model: "/data/mmdet/onnx-faster-rcnn" [2023-05-30 06:42:37.759] [mmdeploy] [error] [ort_net.cpp:205] unhandled exception when creating ORTNet: OrtSessionOptionsAppendExecutionProvider_Cuda: Failed to load shared library [2023-05-30 06:42:37.759] [mmdeploy] [error] [net_module.cpp:54] Failed to create Net backend: onnxruntime, config: { ...
2023-05-30 06:42:37.741984155 [E:onnxruntime:, provider_bridge_ort.cc:901 Ensure] Failed to load library libonnxruntime_providers_shared.so with error: libonnxruntime_providers_shared.so: cannot open shared object file: No such file or directory
@magic-hya hi, you have to prepare onnxruntime lib with gpu version when building mmdeploy by the doc. For example, you should download onnxruntime-linux-x64-gpu-1.10.0.tgz
This issue is marked as stale because it has been marked as invalid or awaiting response for 7 days without any further response. It will be closed in 5 days if the stale label is not removed or if there is no further response.
Checklist
Describe the bug
Instance segmentation model conversion onnx error.
Reproduction
from mmdeploy.apis import torch2onnx from mmdeploy.backend.sdk.export_info import export2SDK img = '/data/mmdet/mmdetection/demo/demo.jpg' work_dir = '/data/mmdet/onnx' save_file = 'end2end.onnx' deploy_cfg = '/root/workspace/mmdeploy/configs/mmdet/instance-seg/instance-seg_sdk_dynamic.py' model_cfg = '/data/mmdet/scnet_r50_fpn_20e_coco.py' model_checkpoint = '/data/mmdet/scnet_r50_fpn_20e_coco-a569f645.pth' device = 'cuda:0'
1. convert model to onnx
torch2onnx(img, work_dir, save_file, deploy_cfg, model_cfg, model_checkpoint, device)
Environment
Error traceback