windows环境下yolov5导出engine文件用于tensorrt部署
1、下载安装tensorrt8.2.0.6
tensorrt8.2.0.6下载地址
https://developer.nvidia.com/nvidia-tensorrt-8x-download
2、tensorrt8.2.0.6python环境安装(对应修改路径即可)
进入cmd
conda activate pytorch1.10
d:
cd D:\TensorRT-8.2.0.6\python
pip install tensorrt-8.2.0.6-cp38-none-win_amd64.whl -i https://pypi.doubanio.com/simple
3、安装完成后运行下述命令即可导出engine
python yolov5/export.py weights=yolov5s.pt, imgsz=[640, 640], batch_size=1, opset=12, verbose=False, include=[‘torchscript’, ‘onnx’, ‘engine’]