-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
When train my custom data, how to load pretrained model? It says not match with default weights. #43
Comments
Hello @h030162, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom model or data training question, please note that Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:
For more information please visit https://www.ultralytics.com. |
@h030162 can you supply code to reproduce your error please? |
@h030162 I just tested this on our colab notebook, and everything works correctly. You can load up an 80 class model with pretrained weights if you are training on coco, or you can change the class count of your model and dataset as well. The only requirement is that the dataset and model class counts must match each other: Dataset: Lines 14 to 15 in ad71d2d
Model: Lines 1 to 2 in ad71d2d
If you change nc, everything still works correctly. In this case the model will be composed of pretrained weights except for the output layers, which are no longer the same shape as the pretrained output layers. The output layers will remain initialized by random weights. |
./yolov5_checkpoint/yolov5_models/yolov5x.pt is not compatible with ./models/yolov5x.yaml. Specify --weights '' or specify a --cfg compatible with ./yolov5_checkpoint/yolov5_models/yolov5x.pt. I just change yolov5x.yaml nc from 80 to 2. and change yaml file in data .nc from 80 to2. names:["dog", "cat"] |
@h030162 I tested this again (a second time) in colab, and everything is still working fine. I updated yolov5x.yaml and coco128.yaml to 160 classes (duplicated the names to reach 160 names), and started training with the following command, all is correct with no problems.
See https://docs.ultralytics.com/yolov5/tutorials/train_custom_data |
@glenn-jocher I also have this problem |
@ou525 if this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. |
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. |
馃殌 Feature
Motivation
Pitch
Alternatives
Additional context
The text was updated successfully, but these errors were encountered: