天天看點

Win10安裝TensorRT

英偉達官方TensorRT8.x下載下傳位址

​​https://developer.nvidia.com/nvidia-tensorrt-8x-download​​

一 Pip安裝TensorRT檔案夾中的.whl檔案

1.python檔案夾

Win10安裝TensorRT
pip install tensorrt-8.4.1.5-cp36-none-win_amd64.whl      
Win10安裝TensorRT

2.graphsurgeon檔案夾

Win10安裝TensorRT
pip install graphsurgeon-0.4.6-py2.py3-none-any.whl      
Win10安裝TensorRT

3.onnx_graphsurgeon檔案夾

pip install onnx_graphsurgeon-0.3.12-py2.py3-none-any.whl -i http://pypi.douban.com/simple/  --trusted-host pypi.douban.com      

4.uff檔案夾

pip install uff-0.6.9-py2.py3-none-any.whl      

二 驗證Python版本的TensorRT是否安裝成功

1.複制庫檔案到cuda

Win10安裝TensorRT

2.驗證

import tensorrt as trt
print(trt.__version__)      
Win10安裝TensorRT

三 驗證C++版本是否可用

1.進去samples\sampleMNIST

Win10安裝TensorRT

2.點選運作

Win10安裝TensorRT

3.檢視是否在bin中生成對應exe

Win10安裝TensorRT

4.從data\mnist中拿一張圖檔進行測試

Win10安裝TensorRT

輸入測試指令

sample_mnist.exe 0.pgm      
Win10安裝TensorRT

測試成功