I want to run optimized inference of models built with pytorch e.g. on my desktop. The C++ example /usr/src/tensorrt/samples/sampleMNIST works. I want to try the same example in the python directory. I don’t know how to install tensorrt with pip or conda, so
import tensorrt
fails. I’m a relative newcomer to python.
Here’s the output of uname -a; nvidia-smi -L; rpm -qa | grep -e tensorrt -e python3-libnv
Linux drk 5.4.8-200.fc31.x86_64 #1 SMP Mon Jan 6 16:44:18 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
GPU 0: GeForce GTX 750 (UUID: GPU-9aff989f-201c-51cb-7db5-dcdae42a7703)
nv-tensorrt-repo-rhel7-cuda10.1-trt6.0.1.5-ga-20190913-1-1.x86_64
python3-libnvinfer-devel-6.0.1-1.cuda10.1.x86_64
python3-libnvinfer-6.0.1-1.cuda10.1.x86_64
tensorrt-6.0.1.5-1.cuda10.1.x86_64
Just follow the steps to install TensorRT at the link above, then pip installing the tensorrt-*-cp3x-none-linux_x86_64.whl should allow you to do import tensorrt in your python code.
Hi,
I actually figured this out a minute ago. On Fedora31, I installed the tensorrt distro rpm and later installed the python bits from the gz file. I must have messed something up because I had to install the cuda10.1 runtimes for the python bits, whereas the tensorrt distro used 10.2.
But it works!
I’ve tried a bit with docker containers, but I haven’t gotten very far. At some point I am going to be training nn’s on cloud-based gpus.
Thanks!