OpenGVLab / InternImage

[CVPR 2023 Highlight] InternImage: Exploring Large-Scale Vision Foundation Models with Deformable Convolutions
https://arxiv.org/abs/2211.05778
MIT License
2.47k stars 231 forks source link

build torchscript extension #275

Closed GitHubYuxiao closed 7 months ago

GitHubYuxiao commented 7 months ago

when I want to export the model to tensorrt ,run the python deploy.py "/home/InternImage/segmentation/deploy/configs/mmseg/segmentation_tensorrt_static-512x512.py" "/home/InternImage/segmentation/configs/ade20k/upernet_internimage_xl_640_160k_ade20k.py" "/home/InternImage/segmentation/checkpoint_dir/upernet_internimage_xl_640_160k_ade20k.pth" "/home/InternImage/segmentation/deploy/demo.png" --work-dir "/home/InternImage/segmentation/work_dirs/upernet_internimage_xl_640_160k_ade20k" --device cuda --dump-info

encounter the error

2024-01-22 06:44:57,566 - mmdeploy - INFO - Execute onnx optimize passes. 2024-01-22 06:44:57,609 - mmdeploy - WARNING - Can not optimize model, please build torchscipt extension. More details: https://github.com/open-mmlab/mmdeploy/blob/master/docs/en/experimental/onnx_optimizer.md 2024-01-22 06:45:01,065 - mmdeploy - ERROR - mmdeploy.apis.pytorch2onnx.torch2onnx with Call id: 0 failed. exit.

could you tell me how to solve it