1 Star 5 Fork 1

cubone/learnopencv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

How to convert a model from PyTorch to TensorRT and speed up inference

The blog post is here: https://www.learnopencv.com/how-to-convert-a-model-from-pytorch-to-tensorrt-and-speed-up-inference/

To run PyTorch part:

python3 -m pip install -r requirements.txt
python3 pytorch_model.py

To run TensorRT part:

  1. Download and install NVIDIA CUDA 10.0 or later following by official instruction: link
  2. Download and extract CuDNN library for your CUDA version (login required): link
  3. Download and extract NVIDIA TensorRT library for your CUDA version (login required): link. The minimum required version is 6.0.1.5. Please follow the Installation Guide for your system and don't forget to install Python's part
  4. Add the absolute path to CUDA, TensorRT, CuDNN libs to the environment variable PATH or LD_LIBRARY_PATH
  5. Install PyCUDA
python3 trt_inference.py

AI Courses by OpenCV

Want to become an expert in AI? AI Courses by OpenCV is a great place to start.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cubone/learnopencv.git
git@gitee.com:cubone/learnopencv.git
cubone
learnopencv
learnopencv
master

搜索帮助