tensorrt yolov8
时间: 2023-08-15 14:08:14 浏览: 201
yolov8量化部署(基于openvino和tensorrt)
5星 · 资源好评率100%
在使用TensorRT加速Yolov8时,你可以按照以下步骤进行操作:
1. 首先,创建一个新的Python环境并安装依赖项,可以使用以下命令:
```
conda create -n yolov8 python==3.8 -y
conda activate yolov8
pip install ultralytics==8.0.5
pip install onnx==1.12.0
```
2. 下载Yolov8的官方权重文件(".pt"文件),可以从以下链接下载所需的权重文件:
```
https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt
https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s.pt
https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m.pt
https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l.pt
https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x.pt
https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x6.pt
```
3. 使用以下命令将权重文件转换为ONNX格式的模型:
```
python -c "from yolov5 import YOLOV5; YOLOV5(task='segment', mode='export', model='yolov8[n s m l x]-seg.pt', format='onnx', opset=12)"
```
请注意,你需要将``替换为所需的Yolov8版本,例如`yolov8s`或`yolov8x`等。这将在models/目录下生成相应的ONNX模型文件。
引用<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [linux下 yolov8 tensorrt模型加速部署【实战】](https://blog.csdn.net/m0_72734364/article/details/128758544)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Yolov8实例分割Tensorrt部署实战](https://blog.csdn.net/qq_41043389/article/details/128682057)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文