티스토리 뷰
PyTorch 모델을 Tensorrt로 변환하기 위해 많은 방법이 있겠지만, 그중에 하나는 PyTorch -> Onnx -> TensorRT 로 변환을 하는 것이다.
위 과정이 매끄럽게 진행 되기 위해선 나의 PyTorch 모델이 Onnx 에서 지원하는 연산들을 통해 변환되는지부터 확인해야 하고, Onnx 연산들이 또 Tensorrt에서 지원되는지 확인해야한다.
PyTorch to Onnx
https://pytorch.org/docs/stable/onnx.html#supported-operators
torch.onnx — PyTorch 1.8.1 documentation
Shortcuts
pytorch.org
위 링크에서는 PyTorch to Onnx 과정에서 공식적으로 지원되는 연산들을 확인할 수 있다.
지원되지 않는 연산(예를 들어 Deformable Conv...)은 직접 PyTorch to Onnx 변환이 되도록 코드를 작성해줘야한다.
https://github.com/onnx/tutorials/blob/master/PyTorchCustomOperator/README.md
onnx/tutorials
Tutorials for creating and using ONNX models. Contribute to onnx/tutorials development by creating an account on GitHub.
github.com
위 링크에서는 PyTorch to Onnx 과정에서 공식적으로 지원되지 않는 연산을 어떻게 처리할 수 있는지에 대한 내용이 설명돼있다. (아직 안해봄...)
Onnx to TensorRT
https://github.com/onnx/onnx-tensorrt/blob/master/docs/operators.md
onnx/onnx-tensorrt
ONNX-TensorRT: TensorRT backend for ONNX. Contribute to onnx/onnx-tensorrt development by creating an account on GitHub.
github.com
위 링크에서는 Onnx to TensorRT 과정에서 공식적으로 지원되는 연산들을 확인할 수 있다.
'Deep Learning > PyTorch' 카테고리의 다른 글
[PyTorch] timm(rwightman/pytorch-image-models) 백본 스테이지별 채널 수 확인 코드 (0) | 2021.06.18 |
---|---|
[PyTorch] Gradient accumulation 예제 코드 (0) | 2021.06.16 |
RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)` (0) | 2021.05.23 |
[PyTorch] Mish 메모리 이슈 (0) | 2021.02.26 |
[PyTorch & LibTorch] OpenCV Image to Normalized Tensor C++ 코드 (0) | 2021.02.18 |
- Total
- Today
- Yesterday
- 이분탐색
- 백준 11053
- 조합
- ㅂ
- 단축키
- C++ Deploy
- 위상 정렬 알고리즘
- 백트래킹
- LCA
- Lowest Common Ancestor
- 백준 1766
- 가장 긴 증가하는 부분 수열
- 파이참
- MOT
- 자료구조
- 백준 11437
- 백준
- PyCharm
- 인공지능을 위한 선형대수
- 문제집
- 순열
- cosine
- FairMOT
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |