marcoslucianops / DeepStream-Yolo

NVIDIA DeepStream SDK 7.0 / 6.4 / 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 implementation for YOLO models
MIT License
1.44k stars 357 forks source link

Triton server fails to infer on yolo 7 through deepstream #288

Open madisi98 opened 1 year ago

madisi98 commented 1 year ago

WARNING: Num classes mismatch. Configured: 80, detected by network: 0 python3: nvdsparsebbox_Yolo.cpp:137: bool NvDsInferParseCustomYolo(const std::vector&, const NvDsInferNetworkInfo&, const NvDsInferParseDetectionParams&, std::vector&, const uint&, const uint&): Assertion `layer.inferDims.numDims == 3' failed.

Maybe inputs/outputs are not configured properly?

I leave here my inferserver grpc gie config:

infer_config {
  unique_id: 1
  gpu_ids: [0]
  max_batch_size: 1
  backend {
    triton {
      model_name: "yolov7"
      version: -1
      grpc {
        url: "localhost:8001"
        enable_cuda_buffer_sharing: false
      }
    }
  }

  preprocess {
    network_format: IMAGE_FORMAT_RGB
    tensor_order: TENSOR_ORDER_LINEAR
    maintain_aspect_ratio: 1
    frame_scaling_hw: FRAME_SCALING_HW_DEFAULT
    frame_scaling_filter: 1
    normalize {
      scale_factor: 0.0039215697906911373
      channel_offsets: [128, 128, 128]
    }
  }

  custom_lib {
    path : "/app/DeepStream-Yolo/nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so"
  }

  postprocess {
    labelfile_path: "/trtmodels/yolov7/labels.txt"
    detection {
      num_detected_classes: 80
      nms {
        confidence_threshold: 0.25
        iou_threshold: 0.45
        topk : 300
      }
      custom_parse_bbox_func:"NvDsInferParseYolo"
    }
  }

  extra {
    copy_input_to_host_buffers: false
    output_buffer_pool_size: 2
  }
}
input_control {
  process_mode: PROCESS_MODE_FULL_FRAME
  operate_on_gie_id: -1
  interval: 0
}
marcoslucianops commented 1 year ago

Hi. Probably the triton doesn't pass the global variable kNUM_CLASSES to the nvdsparsebbox_Yolo.cpp file. If the model is working, you can remove the lines 105-109 in the nvdsparsebbox_Yolo.cpp file to prevent this message.