TensorRT란?

TensorRT는 이미 학습된 모델을 최적화 하여 추론 속도를 향상 시켜주는 모델 최적화 엔진입니다.

 

 


TensorRT 설치

https://developer.nvidia.com/tensorrt

 

NVIDIA TensorRT

NVIDIA TensorRT What is NVIDIA TensorRT Features Performance Metrics Framework Integrations Leading Adopters Resources NVIDIA TensorRT NVIDIA® TensorRT™ is an SDK for high-performance deep learning inference. It includes a deep learning inference optimi

developer.nvidia.com

 

위 사이트에 접속하여

GET STARTED 를 눌러줍니다.

 

 

 

Download Now> 를 눌러줍니다.

로그인 후 아래와 같이 버전별로 다운로드 할 수 있는 창이 뜹니다.

 

 

원하는 버전을 클릭해준 후

□ I Agree To the Terms of the NVIDIA TensorRT License Agreement

체크를 해준후 상세 버전을 다운로드 받을 수 있습니다.

 

TensorRT 다운로드 후

환경 변수를 설정해주면 됩니다.

 

ex)

1. Window

시스템 변수에 TRT_HOME으로 추가를 해줍니다.

그 후 Path -> 편집 -> 위 사진처럼 %TRT_HOME%\lib 추가

 

2. Linux

Linux는 ~/.bashrc 에 환경변수를 추가해주면 됩니다.

 

 

TensorRT Docker 이용할시

https://docs.nvidia.com/deeplearning/tensorrt/container-release-notes/rel_21-12.html#rel_21-12

 

Container Release Notes :: NVIDIA Deep Learning TensorRT Documentation

The NVIDIA container image for TensorRT, release 21.12, is available on NGC. Contents of the TensorRT container This container includes the following: The TensorRT C++ samples and C++ API documentation. The samples can be built by running make in the /work

docs.nvidia.com

cuda 경로 : usr/local/cuda-xx/

cudnn 경로 : usr/include

 

TRT_HOME 경로 잡기:

  • TRT_HOME : /workspace/tensorrt
  • include : /usr/include/x86-64-linux-gnu
  • lib : /usr/lib/x86-64-linux-gnu

 

 

Visual Studio 에서 사용하기

Visual Studio에서 사용하기 위해서는 경로를 잘 잡아주어야 합니다.

 

1. 프로젝트 속성 -> C/C++ -> General -> Additional Include Directories

경로\TensorRT-8.2.3.0\include 추가

 

2. 프로젝트 속성 -> Linker -> General -> Additional Library Directories

경로\TensorRT-8.2.3.0\lib 추가

 

3. 프로젝트 속성 -> Linker -> Input -> Additional Dependencies

nvinfer.lib
nvinfer_plugin.lib
nvonnxparser.lib
nvparsers.lib

추가

'Deep Learning > TensorRT' 카테고리의 다른 글

06. TensorRT Resnet18  (0) 2023.03.21
05. TensorRT VGG  (0) 2023.03.11
04. TensorRT Custom Layer 만들기  (0) 2022.02.14
02. TensorRT 다루기  (0) 2022.02.11

+ Recent posts