Skip to content

Commit

Permalink
TensorRT pip install
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jan 11, 2022
1 parent 9b13a59 commit b3eaf50
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
}
]
}
}

0 comments on commit b3eaf50

Please sign in to comment.