From b3eaf5008bb8a34de481a6ef7ac8ba520d97b70e Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 10 Jan 2022 16:49:10 -1000 Subject: [PATCH] TensorRT pip install --- tutorial.ipynb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tutorial.ipynb b/tutorial.ipynb index fb808cf..97f9074 100644 --- a/tutorial.ipynb +++ b/tutorial.ipynb @@ -1090,19 +1090,13 @@ }, "source": [ "# TensorRT \n", - "# https://developer.nvidia.com/nvidia-tensorrt-download\n", - "!lsb_release -a # check system\n", - "%ls /usr/local | grep cuda # check CUDA\n", - "!wget https://ultralytics.com/assets/TensorRT-8.2.0.6.Linux.x86_64-gnu.cuda-11.4.cudnn8.2.tar.gz # download\n", - "![ -d /content/TensorRT-8.2.0.6/ ] || tar -C /content/ -zxf ./TensorRT-8.2.0.6.Linux.x86_64-gnu.cuda-11.4.cudnn8.2.tar.gz # unzip\n", - "%pip list | grep tensorrt || pip install /content/TensorRT-8.2.0.6/python/tensorrt-8.2.0.6-cp37-none-linux_x86_64.whl # install\n", - "%env LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:/content/cuda-11.1/lib64:/content/TensorRT-8.2.0.6/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64 # add to path\n", - "\n", - "!python export.py --weights yolov5s.pt --include engine --imgsz 640 640 --device 0\n", - "!python detect.py --weights yolov5s.engine --imgsz 640 640 --device 0" + "# https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing-pip\n", + "!pip install -U nvidia-tensorrt --index-url https://pypi.ngc.nvidia.com # install\n", + "!python export.py --weights yolov5s.pt --include engine --imgsz 640 640 --device 0 # export\n", + "!python detect.py --weights yolov5s.engine --imgsz 640 640 --device 0 # inference" ], "execution_count": null, "outputs": [] } ] -} +} \ No newline at end of file