Closed spa-yhson closed 1 year ago
If seems you are using tensorrt backend. Therefore, you can ignore failed to load library libmmdeploy_ort_net.so
.
The log shows two errors.
[ WARN:0@4.479] global loadsave.cpp:244 findDecoder imread_('cityscapes_demo.png'): can't open/read file: check file path/integrity
Please check path of cityscapes_demo.png
, the error indicate that it can't read the image.
[2023-06-26 12:30:51.244] [mmdeploy] [error] [model.cpp:40] Failed to load model: "/mnt/mmsegmentation/work_dirs/pidnet-l_2xb6-120k_1024x1024-cityscapes/end2end.engine", implementations tried: [("DirectoryModel", 0)]
You should pass the path of model folder instead of the path of engine file. Try /mnt/mmsegmentation/work_dirs/pidnet-l_2xb6-120k_1024x1024-cityscapes/
(don't forget pass --dump-info when you convert the model)
I confirmed that cityscapes_demo.png file is certainly located in the defined path. Also, changing the path to the model folder yields the same error.
@spa-yhson
image_segmentation.py accept three positional arguments device_name
, model_path
and image_path
error 1:
[ WARN:0@4.479] global loadsave.cpp:244 findDecoder imread_('cityscapes_demo.png'): can't open/read file: check file path/integrity
This error is printed by cv2, you can check if the img is ndarray or None this line: https://github.com/open-mmlab/mmdeploy/blob/main/demo/python/image_segmentation.py#L33
If you are sure the image path is right, then you need to reinstall opencv to make sure you can read image.
error 2: you should pass the model folder instead of engine file, according to your error log, you should pass /mnt/mmsegmentation/work_dirs/pidnet-l_2xb6-120k_1024x1024-cityscapes/
the sdk need not only the backend file (.engine for trt, etc.), but also some json files that describe the model and pipeline. the model structure shoud be like:
.
├── deploy.json
├── detail.json
├── end2end.engine
├── end2end.onnx
└── pipeline.json
If you model directory doesn't contains there json files, you shoud reconvert the model and pass --dump-info
to deploy.py
Thank you so much for your help. The issue resolved.
Checklist
Describe the bug
When I run
/demo/python/image_segmentation.py
, it produces an error that itfailed to load library libmmdeploy_ort_net.so
.I have created the environment by using the docker image provided.
Reproduction
python ./demo/python/image_segmentation.py cuda /mnt/mmsegmentation/work_dirs/pidnet-l_2xb6-120k_1024x1024-cityscapes/end2end.engine cityscapes_demo.png
I did not make any modifications on the code or config.
Environment
Error traceback