Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretrained weights without a ".weights" suffix are silently ignored #69

Open
pete-machine opened this issue Jun 10, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@pete-machine
Copy link

pete-machine commented Jun 10, 2024

To report a bug, please provide the following:

  • the output of the darknet version command
Darknet v2.0-208-ga7901e02-dirty
CUDA runtime version 12010 (v12.1), driver version 12020 (v12.2)
cuDNN version 12020 (v8.9.5), use of half-size floats is ENABLED
=> 0: Tesla T4 [#7.5], 14.6 GiB
OpenCV v4.2.0
  • the exact command you ran
    Something like this:
./darknet detector train data/obj.data yolo-obj.cfg yolov4.conv.137
  • the operating system you are using
    Ubuntu 22.04

I found that pre-trained weights without the ".weights" suffix are silently ignored in this fork of darknet.
This is a critical issue for users transitioning from AlexeyAB, where pretrained-models or custom model weights
are listed without a .weights suffix (AlexeyAB documentation)... (Instead model files uses the final layer as a suffix e.g. 137 for yolov4.conv.137 )

Users may incorrectly assume that pre-trained weights are loaded with HankAI and they will either 1) achieve worse performance without ever noticing or 2) wonder why the model converges a lot slower than AlexeyAB - at least I did.

Screenshot from 2024-06-10 14-15-01
Showing hankai and Alexey trainings with and without pretrained weights

The line for mapping command line arguments to weight filename is:

# From line 146 in darknet_cfg_and_state.cpp
if (extension == ".weights"	and weights_filename.empty())	{ weights_filename	= path; }

A fix could be to throw an error if all arguments are not parsed correctly or throw an error message if a user tries to load a model with a integer-suffix.

@pete-machine pete-machine added the bug Something isn't working label Jun 10, 2024
@pete-machine pete-machine changed the title Pretrained weights without ".weights" are silently being ignored Pretrained weights without a ".weights" suffix are silently ignored Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants