DeepStream-Yolo icon indicating copy to clipboard operation
DeepStream-Yolo copied to clipboard

Model not supported error while converting Yolov7 weights 'IDetect layer'

Open junaidp1 opened this issue 2 years ago • 7 comments

I am getting Model not supported error when I use gen_wts_yoloV7.py to generate weights and config file. Yolov7 model that I have contains IDetect layer which I don't see in the gen_wts_yoloV7.py.

Any idea how to fix it? Thanks

junaidp1 avatar Aug 25 '22 15:08 junaidp1

The IDetect layer isn't implemented yet. I will add soon.

marcoslucianops avatar Aug 25 '22 22:08 marcoslucianops

I also have a custom Yolo v7 model and get the same error when trying to convert using gen_wts_yoloV7.py. How can I tell if the error is due the same reason described here, or due to some other reason?

UPDATE:

Ok, I have modified gen_wts_yoloV7.py to print name of the model, it is also IDetect layer in my case.

GiorgosBetsos avatar Sep 08 '22 14:09 GiorgosBetsos

When can we expect implementation of IDetect layer? Or maybe you can let me know which version of Yolov7 is using Detect layer instead of IDetect?

ksd777 avatar Sep 09 '22 06:09 ksd777

IDetect support is what we are waiting for to complete an important project. Any ETA for that ?

franckmarineai avatar Sep 15 '22 11:09 franckmarineai

Need IDetect support badly.
I'm assuming that there are yolov7 models that don't use IDetect. Which ones? At least need an interim solution.

rbgreenway avatar Sep 16 '22 21:09 rbgreenway

We have the same error while trying to convert the custom yolov7 model.

emirkiani avatar Sep 19 '22 10:09 emirkiani

The IDetect layer is used in re-parameterized models. I will work on it in the next days.

marcoslucianops avatar Sep 23 '22 13:09 marcoslucianops

@marcoslucianops I dont think you need to support idetect :). From my understanding Idetect is for training, detect is for inference (faster) as per the scripts in the cfg/deploy folder of yolov7. I just got this working with V7 tiny using your current tools.

This has been tested with Deepstream 6.0.1 running on a jetson nano.

Steps:

  1. Reparamitise the model. Note you need to update the reparamitizer script replacing 105 with 77 if you are using yolov7-tiny or another unsupported model.
  2. use the config from cfg/deploy supplied in repo.
  3. convert as per usual using existing tooling.

pullmyleg avatar Oct 07 '22 01:10 pullmyleg

Yes, the IDetect is for training. You need to do the reparameterization to convert the model using the gen_wts_yoloV7.py.

marcoslucianops avatar Nov 17 '22 03:11 marcoslucianops

https://colab.research.google.com/drive/17HIHsKAdfTbZQSu7LxZIwtHQr7LZYSKD?usp=sharing this colab file can help you guys in .pt to .wts model conversion

animeesh avatar Jan 04 '23 04:01 animeesh

Weights obtained from re-parameterization differ from original weights. I am getting different recall & precision on same images with 2 models.

anchalgupta2412 avatar Jan 11 '23 13:01 anchalgupta2412

Weights obtained from re-parameterization differ from original weights. I am getting different recall & precision on same images with 2 models.

Did you test using YOLOv7 repo?

marcoslucianops avatar Jan 26 '23 10:01 marcoslucianops