Triton Information
What version of Triton are you using?
nvcr.io/nvidia/tritonserver:23.04-py3
Are you using the Triton container or did you build it yourself?
no To Reproduce
Steps to reproduce the behavior.
yolo export model=best.pt format=onnx opset=15
yolo export model=best.pt format=torchscripts
nano config.pbtxt
docker run --gpus all -it --rm -v /data/triton/models:/models -p 8000:8000 -p 8001:8001 -p 8002:8002 nvcr.io/nvidia/tritonserver:23.04-py3 tritonserver --model-repository=/models --log-verbose=1
Describe the models (framework, inputs, outputs), ideally include the model configuration file (if using an ensemble include the model configuration file for that as well).
Description yolov8n.pt模型转torchscripts和onnx,在triton server或Deepytorch Inference上推理,精度下降
Triton Information What version of Triton are you using? nvcr.io/nvidia/tritonserver:23.04-py3 Are you using the Triton container or did you build it yourself? no
To Reproduce Steps to reproduce the behavior.
docker run --gpus all -it --rm -v /data/triton/models:/models -p 8000:8000 -p 8001:8001 -p 8002:8002 nvcr.io/nvidia/tritonserver:23.04-py3 tritonserver --model-repository=/models --log-verbose=1
boxes: tensor([[ 7.4102, 36.6875, 14.7109, 73.1250], [ 15.0469, 26.4531, 29.8750, 52.8438], [ 20.6875, 15.2891, 40.5000, 30.6094], ..., [472.5000, 575.0000, 348.7500, 143.5000], [503.0000, 568.0000, 326.0000, 178.0000], [545.0000, 586.5000, 323.2500, 224.0000]], device='cuda:0') scores: tensor([0., 0., 0., ..., 0., 0., 0.], device='cuda:0') class_ids: tensor([0, 0, 0, ..., 0, 0, 0], device='cuda:0') class_ids>0.7: tensor([], device='cuda:0', dtype=torch.int64)
_ @why this classids is 0?
Describe the models (framework, inputs, outputs), ideally include the model configuration file (if using an ensemble include the model configuration file for that as well).
yolov10_triton.py `import io import os from io import BytesIO
import cv2 import torch import torchvision from PIL import Image from tritonclient.grpc import InferenceServerClient, InferInput from tritonclient.utils import *
def getIou(box1, box2, inter_area): box1_area = box1[2] box1[3] box2_area = box2[2] box2[3] union = box1_area + box2_area - inter_area iou = inter_area / union return iou
def getInter(box1, box2): box1_x1, box1_y1, box1_x2, box1_y2 = box1[0] - box1[2] / 2, box1[1] - box1[3] / 2, \ box1[0] + box1[2] / 2, box1[1] + box1[3] / 2 box2_x1, box2_y1, box2_x2, box2_y2 = box2[0] - box2[2] / 2, box2[1] - box1[3] / 2, \ box2[0] + box2[2] / 2, box2[1] + box2[3] / 2 if box1_x1 > box2_x2 or box1_x2 < box2_x1: return 0 if box1_y1 > box2_y2 or box1_y2 < box2_y1: return 0 x_list = [box1_x1, box1_x2, box2_x1, box2_x2] x_list = np.sort(x_list) x_inter = x_list[2] - x_list[1] y_list = [box1_y1, box1_y2, box2_y1, box2_y2] y_list = np.sort(y_list) y_inter = y_list[2] - y_list[1] inter = x_inter * y_inter return inter
class TritonInferer: def init(self, model_name, server_url='localhost:8001'): self.img_src = None self.img = None self.triton_client = InferenceServerClient(url=server_url, verbose=False) self.model_name = model_name self.input_name = 'images' self.output_name = 'output0' self.image_size = 640 self.conf_thres = 0.5 self.iou_thres = 0.5
bottle_name = 'v10_bottle5_240925' bottle_plus_name = 'v10_bottle_plus11_240925' yolov8_wt = str(r"D:\workspace_py\pxys-model-rest\weights\bottle{}.pt".format(bottle_name)) yolov8_plus_wt = str(r"D:\workspace_py\pxys-model-rest\weights\bottle{}.pt".format(bottle_plus_name))
triton_inferer = TritonInferer(model_name='bottle_plus_onnx')
image_folder = r'E:\data\数据库\9月瓶\新品由柑汁\obj_train_data\images'
for filename in os.listdir(image_folder): if filename.endswith('.jpg') or filename.endswith('.png'): image_path = os.path.join(image_folder, filename)
` Expected behavior A clear and concise description of what you expected to happen. expected not 0