YoloV2: Number of unused weights left : 1

(Xavier, ds4.0)

Hi,

I’m trying to convert a slightly modified yolov2 network (attached, i added the .log in the filename to be able to uploadyolov2.cfg.log (1.7 KB) ) to trt, with the weights and cfg. I’m generally following the ds example.

I get the error: “Number of unused weights left : 1”.

Notes:

  1. The model (cfg+weights) works fine in darknet ( AlexeyAB codebase).
    2.I removed the assert (yolo.cpp:350), tried to run, it loads and generate a model, but inference results are empty (model not working). I made sure all relevant changes (anchors, stride,sizes etc) are correct.
  2. I tried to chop the first bytes, still get the same error.

Any ideas ?

Thanks for the help !

Hi,

The yolo network builder present in the samples is tested on standard yolo models trained using this repo - https://github.com/pjreddie/darknet

However, you may be having an issue with the header in the model file. If you refer to loadWeights() function in trt_utils.cpp, we are ignoring 4 floats for header yolov2 and 5 floats for all the others. Can you update that to 5 floats for yolov2 as well and try ?

Here’s the snippet i’m referring to -
`` if (networkType == “yolov2”)
{
// Remove 4 int32 bytes of data from the stream belonging to the header
file.ignore(4 * 4);
}
else if ((networkType == “yolov3”) || (networkType == “yolov3-tiny”)
|| (networkType == “yolov2-tiny”))
{
// Remove 5 int32 bytes of data from the stream belonging to the header
file.ignore(4 * 5);
}`