open-mmlab / mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
https://mmsegmentation.readthedocs.io/en/main/
Apache License 2.0
7.98k stars 2.57k forks source link

onnx2tensorrt #2807

Open gybwyy-art opened 1 year ago

gybwyy-art commented 1 year ago

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. The bug has not been fixed in the latest version.

Describe the bug When I executed tools/onnx2tensorrt.py , I encountered this error:[network.cpp::validate::3109] Error Code 4: Internal Error (onnx::Unsqueeze_1: optimization profile is missing values for shape input)

Reproduction

  1. What command or script did you run?

python3 onnx2tensorrt.py ./asphlt_segformer.py ./tmp.onnx --trt -file ./model.trt --input-img ../../online/WM006_666_1664533692000_1664552812000_20220930a_921.jpg --show --verify --mi n-shape 1 3 1280 960 --max-shape 1 3 1280 960

Environment sys.platform: linux [0/1883] Python: 3.8.10 (default, Mar 13 2023, 10:26:41) [GCC 9.4.0] CUDA available: True GPU 0,1,2,3,4,5,6,7: Tesla T4 CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 11.7, V11.7.99 GCC: x86_64-linux-gnu-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 PyTorch: 1.13.0+cu117 PyTorch compiling details: PyTorch built with:

TorchVision: 0.14.0+cu117 OpenCV: 4.7.0 MMCV: 1.7.1 MMCV Compiler: GCC 9.3 MMCV CUDA Compiler: 11.7 MMSegmentation: 0.30.0+db09c54

TensorRT-8.4.1.5 onnx 1.13.1
onnx-graphsurgeon 0.3.12
onnxruntime 1.14.1

xiexinch commented 1 year ago

Hi @gybwyy-art, This script is no longer maintained, we suggest using MMDeploy to convert your model.