1,介紹
torch2trt 是一個易於使用的PyTorch到TensorRT轉換器
2,安裝
sudo apt-get install libprotobuf* protobuf-compiler ninja-build
git clone https://github.com/NVIDIA-AI-IOT/torch2trt
cd torch2trt
python setup.py install --plugins # 虛擬環境
報錯,#NvInfer.h,找不到,修改setup.py
def trt_inc_dir():
return "../targets/x86_64-linux-gnu/include"
def trt_lib_dir():
return "../targets/x86_64-linux-gnu/lib"
3,應用