tensorrt踩坑日记(python pytorch 转 onnx 推理加速)
配置:
Ubuntu 16.04
python 3.6
onnx 1.6
pytorch 1.5
pycuda 2019.1.2
torchvision 0.1.8
建议详读,先安装好环境
官网指导手册
步骤:
1.将pytorch模型转换成onnx模型
这边用的是Darknet生成的pytoch模型
import torch
from torch.autograd import Variable
import onnx
input_name = ['input']
output_n
原创
2020-08-01 16:59:47 ·
4085 阅读 ·
2 评论