-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
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
The autoanchor result is not same as anchors in model #7058
Comments
@PonyPC your console output shows |
@PonyPC also your example is not reproducible since no one but you has access to your dataset. If you want our team to investigate the issue must be reproducible by us. How to create a Minimal, Reproducible ExampleWhen asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:
For Ultralytics to provide assistance your code should also be:
If you believe your problem meets all the above criteria, please close this issue and raise a new one using the 🐛 Bug Report template with a minimum reproducible example to help us better understand and diagnose your problem. Thank you! 😃 |
Can I understand the console output anchors is not reliable? |
@PonyPC anchor order is reversed when it is detected that your model outputs are not ordered in the same direction as the anchor sizes. Some model outputs (FPN heads) are ordered large to small, whereas others (i.e. PANet) heads are ordered small to large. Anchors are always evolved sorted small to large, and then they are reversed if model incompatibility is detected. Either way if you want us to investigate you must supply a fully reproducible example on a common dataset like COCO128, VOC, GlobalWheat, etc. Your example is not reproducible by anyone but yourself since no one knows what |
Lines 18 to 26 in 529fbc1
|
@PonyPC good news 😃! Your original issue may now be fixed ✅ in PR #7060. I investigated AutoAnchor behavior when started with To receive this update:
Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀! |
This is my dataset: |
Glad to see the solution |
Hi, thank you @glenn-jocher . |
Only P4 layer are same. Please consider using my dataset to reproduce. I trimmed every picture so don't worry about the training speed. |
@PonyPC got it. I downloaded your zip, will take a look. |
@glenn-jocher put yolov5-master in unzipped folder, replace '\' with '/' in |
@glenn-jocher It is resolved now, you do a great job. Thanks again, have a nice day. |
@PonyPC awesome, glad everything is fixed!! 😃 |
Search before asking
YOLOv5 Component
Training
Bug
The autoanchor result is not same as anchors in model
The console log is:
But get this from model:
Note: only P4 layer same, P3/P5 not.
Environment
Minimal Reproducible Example
python train.py --device 0 --img 640 --data mydata.yaml --cfg yolov5n.yaml --hyp hyp.scratch-low.yaml --weights '' --batch-size 64 --workers 8 --epochs 300
All is default value except class count equals 1.
You can valid quickly by set epochs to 1.
Additional
I know autoanchor, and what I means the autoanchor result is not same as the model anchor.

Just the follow picture, two circled anchors should be same from P3 to P5 in trains. But in my case they are not.
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: