virtualenv triton_env --python=python3.11
source triton_env/bin/activatepython -m venv triton_env
# git bash
source triton_env/Scripts/activate
# cmd
.\triton_env\Scripts\activate.bat
# powershell
.\triton_env\Scripts\activate.ps1python -m pip install --upgrade pip
# ultralytics yolo
pip install -U ultralytics==8.0.51
pip install -U tritonclient[all]yolo export model=yolov8n.pt format=onnx dynamic=True opset=16
mkdir models/yolov8_onnx/1/
mv yolov8n.onnx models/yolov8_onnx/1/Dockerfile
- The
xx.yy-py3image contains the Triton inference server with support for Tensorflow, PyTorch, TensorRT, ONNX and OpenVINO models. - The
xx.yy-py3-sdkimage contains Python and C++ client libraries, client examples, and the Model Analyzer. - The
xx.yy-py3-minimage is used as the base for creating custom Triton server containers as described in Customize Triton Container. - The
xx.yy-pyt-python-py3image contains the Triton Inference Server with support for PyTorch and Python backends only. - The
xx.yy-tf2-python-py3image contains the Triton Inference Server with support for TensorFlow 2.x and Python backends only.
# https://org.ngc.nvidia.com/setup/api-key
docker login nvcr.io
Username: $oauthtoken
Password:
Login Succeeded
DOCKER_NAME="yolov8-triton"
docker build -t $DOCKER_NAME -f Dockerfile .docker run --rm -p8000:8000 -p8001:8001 -p8002:8002 \
-v $(PWD)/models:/models \
yolov8-triton \
tritonserver --model-repository=/modelsdocker run --gpus=1 \
--rm -p8000:8000 -p8001:8001 -p8002:8002 \
-v $(PWD)/models:/models \
yolov8-triton \
tritonserver --model-repository=/modelssource triton_env/bin/activate
python main.py
open /tmp/yolov_output.jpg