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

Which weights file should I use when I choose the cfg yolov3-tiny.cfg?@Samjith888 your command automatically loads the ultralytics49.pt backbone, which requires yolov3-spp.cfg. You must remove the backbone by using --weights '', or specify a weights-cfg combination that is compatible. #1548

Closed
Suncheng2019 opened this issue Nov 5, 2020 · 4 comments
Labels
Stale Stale and schedule for closing soon

Comments

@Suncheng2019
Copy link

Suncheng2019 commented Nov 5, 2020

I want to add attention se in yolov3-tiny.cfg, but I don't have a compatible weights. Thank you!
@Samjith888 your command automatically loads the ultralytics49.pt backbone, which requires yolov3-spp.cfg. You must remove the backbone by using --weights '', or specify a weights-cfg combination that is compatible.

This error is caused by a user supplying incompatible --weights and --cfg arguments. To solve this you must specify no weights (i.e. random initialization of the model) using --weights '' and any --cfg, or use a --cfg that is compatible with your --weights. If none are specified, the defaults are --weights ultralytics49.pt and --cfg cfg/yolov3-spp.cfg.

Compatible --weights --cfg combinations:

python3 train.py --weights yolov3.pt --cfg cfg/yolov3.cfg
python3 train.py --weights yolov3.weights --cfg cfg/yolov3.cfg
python3 train.py --weights yolov3-spp.pt --cfg cfg/yolov3-spp.cfg
python3 train.py --weights ultralytics49.pt --cfg cfg/yolov3-spp.cfg
python3 train.py --weights ultralytics68.pt --cfg cfg/yolov3-spp.cfg

To train from scratch (randomly initialized weights), use:

python3 train.py --weights '' --cfg cfg/*.cfg  # any cfg will work here

ultralytics49.pt is currently the highest performing YOLOv3 model (trained from scratch using this repo) available at the default img-size of 416 (see #310), which is the reason it is used as the default backbone.

Originally posted by @glenn-jocher in #657 (comment)

@xiaomahencai
Copy link

but when I use the command python train.py --weights '' --cfg cfg/yolov3-tiny.cfg,also error as follow:
KeyError: "weights/yolov3-tiny.pt is not compatible with cfg/yolov3-tiny.cfg. Specify --weights '' or specify a --cfg compatible with weights/yolov3-tiny.pt. See #657"

@xiaomahencai
Copy link

I also have an error,when I run the command python train.py --weights yolov3.pt --cfg cfg/yolov3.cfg,error as follow:yolov3.pt is missing,please downloading http:....,but!the file had just been downloaded!!!please help me!!!thank you!!!

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Dec 22, 2020
@glenn-jocher
Copy link
Member

@xiaomahencai i understand your frustration. It seems you're encountering compatibility issues between the weights and the configuration file. When using YOLOv3, it's essential to ensure that your specified weights are compatible with the chosen configuration file.

For yolov3-tiny.cfg, it is critical to specify compatible weights. The ultralytics49.pt backbone, which is used by default, requires the yolov3-spp.cfg configuration file.

To resolve the issue, you can specify no weights using --weights '' and use cfg/yolov3-tiny.cfg. Alternatively, you can choose a compatible --weights option for yolov3-tiny.cfg or specify a --cfg that matches your selected --weights configuration.

If you encounter issues with yolov3.pt not being recognized even after it's been downloaded, please ensure that the file is located in the correct directory specified in the command or verify the file's integrity.

If you need further assistance or have more questions, feel free to ask!

Remember, your contributions to the YOLO community are greatly appreciated. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Stale and schedule for closing soon
Projects
None yet
Development

No branches or pull requests

3 participants