Closed JonyJiang123 closed 7 months ago
But I use api to predict, It's works well. Here is api code: model_cfg = 'mmdetection/configs/myconfig/mask-rcnn_swin-t-p4-w7_fpn_1x_coco.py' deploy_cfg = 'mmdeploy/configs/mmdet/detection/detection_tensorrt_dynamic-320x320-1344x1344.py' backend_files = ['work_dir/trt/swin-transformer/end2end.engine'] img = 'mmdetection/data/1909/1909-ascus/17_8.png' device = 'cuda' result = inference_model(model_cfg, deploy_cfg, backend_files, img, device) print(result)
@JonyJiang123
deploy_cfg 不对, configs/mmdet/detection 对应的task是object detection,swin transformer 应该是 Instance Segmentation,你应该用configs/mmdet/instance-seg 下面的
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.
This issue is closed because it has been stale for 5 days. Please open a new issue if you have similar issues or you have any new updates now.
Checklist
Describe the bug
use demo sdk to predict swin-transformer trt model (mask-rcnn_swin-t-p4-w7_fpn_1x_coco.py), get this error
Reproduction
from mmdeploy.apis import inference_model from mmdeploy_runtime import Detector import cv2
detector = Detector(model_path='work_dir/trt/swin-transformer/', device_name=device, device_id=0) image = cv2.imread('mmdetection/data/1909/1909-ascus/17_8.png') print(image.shape) bboxes, labels, masks = detector(image)
Environment
Error traceback
oading mmdeploy_trt_net.dll ... loading mmdeploy_ort_net.dll ... [2023-11-24 10:57:21.832] [mmdeploy] [info] [model.cpp:35] [DirectoryModel] Load model: "work_dir/trt/swin-transformer/" [2023-11-24 10:57:22.873] [mmdeploy] [warning] [trt_net.cpp:24] TRTNet: TensorRT was linked against cuDNN 8.9.0 but loaded cuDNN 8.3.2 [2023-11-24 10:57:22.876] [mmdeploy] [warning] [trt_net.cpp:24] TRTNet: TensorRT was linked against cuDNN 8.9.0 but loaded cuDNN 8.3.2 [2023-11-24 10:57:23.724] [mmdeploy] [warning] [trt_net.cpp:24] TRTNet: CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading (640, 1280, 3) [2023-11-24 10:57:23.750] [mmdeploy] [error] [instance_segmentation.cpp:78] invalid argument (1)