Tim M 57b5cefde5 Updated all `.md` files to contain newest image 2 년 전
..
README.md 57b5cefde5 Updated all `.md` files to contain newest image 2 년 전
imagenet_classes.txt e84a1265d2 add code for the article How to convert a model from PyTorch to TensorRT and speed up inference 4 년 전
pytorch_model.py 1e075c908b Replace C++ API by Python API for TensorRT 4 년 전
requirements.txt 1247ac90ec add requirements.txt 4 년 전
resnet50.onnx 20eb35de11 add lfs 4 년 전
trt_inference.py 1e075c908b Replace C++ API by Python API for TensorRT 4 년 전
turkish_coffee.jpg e84a1265d2 add code for the article How to convert a model from PyTorch to TensorRT and speed up inference 4 년 전

README.md

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

This repository contains code for How to convert a model from PyTorch to TensorRT and speed up inference blogpost.

download

To run PyTorch part: ```shell script 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](https://developer.nvidia.com/cuda-10.0-download-archive)
2. Download and extract CuDNN library for your CUDA version (login required): [link](https://developer.nvidia.com/rdp/cudnn-download)
3. Download and extract NVIDIA TensorRT library for your CUDA version (login required): 
[link](https://developer.nvidia.com/nvidia-tensorrt-6x-download). 
The minimum required version is 6.0.1.5. 
Please follow the [Installation Guide](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html) 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](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing-pycuda)

```shell script
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.