darknet-visualizer icon indicating copy to clipboard operation
darknet-visualizer copied to clipboard

The last layer is ignored

Open whdlgp opened this issue 3 years ago • 4 comments

Problem

  • The last layer is ignored when reading cfg file and store it to options
  • For example, if read yolov4.cfg. The last "yolo" layer will be ignored

Solution

Just add one line in read_cfg.py

like this, in read_cfg.py

        elif(i[0] in ['\0','#',';']):
            pass
        else:
            read_option(i,current)
    options.append(current.copy()) #add this after line 19
    file.close()
    return options[1:]

This Darknet cfg visualizer is simple and nice. If this repository is still alive, Please check this :)

If apply this, I can read Yolo v4, Yolo v4 Tiny and Yolo v4 Tiny 3l.

whdlgp avatar Apr 15 '21 10:04 whdlgp

Thanks for sharing this! Saved me the effort of debugging. :) I can confirm that it also works for YOLOv7-tiny visualisation.

JeremyKeusters avatar Aug 11 '22 08:08 JeremyKeusters

If you mean this, https://github.com/WongKinYiu/yolov7 There is no config file for darknet.

Maybe you can visualize it with this tool https://github.com/lutzroeder/Netron

whdlgp avatar Aug 11 '22 10:08 whdlgp

No, I meant that it actually also does work for YOLOv7-tiny. AlexeyAB released a cfg file here.

JeremyKeusters avatar Aug 11 '22 10:08 JeremyKeusters

Yes, It works.

below image is YOLOv7-tiny graph generated by this visualizer

Imgur

whdlgp avatar Aug 11 '22 12:08 whdlgp