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

The new repo has a bug. #3569

Closed
SpongeBab opened this issue Jun 10, 2021 · 2 comments · Fixed by #3887
Closed

The new repo has a bug. #3569

SpongeBab opened this issue Jun 10, 2021 · 2 comments · Fixed by #3887

Comments

@SpongeBab
Copy link
Contributor

SpongeBab commented Jun 10, 2021

@glenn-jocher hi,I think this modify will make mistakes.

🐛 Bug

A clear and concise description of what the bug is.

Traceback (most recent call last):
  File "E:\yolov5\train.py", line 623, in <module>
    hyp[k] = max(hyp[k], v[1])  # lower limit
KeyError: 'anchors'

I think it is because the following is commented in hyp.scratch,yaml.

 # anchors: 3  # anchors per output layer (0 to ignore)

Input

I used the pretrained weights:https://github.com/google/automl/tree/master/efficientnetv2.

I used the anchors,and it worked.

Output:

Image sizes 704 train, 704 test
Using 0 dataloader workers
Logging results to runs\train\evolve
Starting training for 300 epochs...

     Epoch   gpu_mem       box       obj       cls     total    labels  img_size
     0/299     2.57G     0.121    0.2745         0    0.3955        77       704: 100%|██████████| 350/350 [01:55<00:00,  3.04it/s]

@SpongeBab SpongeBab added the bug Something isn't working label Jun 10, 2021
@glenn-jocher
Copy link
Member

@SpongeBab yes that is correct. If the anchor field is enabled in your hyp file then it will supercede the anchors in your model.pt or model.yaml file, so this line should mainly be uncommented when run evolution.

@glenn-jocher glenn-jocher removed the bug Something isn't working label Jun 10, 2021
@glenn-jocher glenn-jocher linked a pull request Jul 5, 2021 that will close this issue
@glenn-jocher
Copy link
Member

glenn-jocher commented Jul 5, 2021

@SpongeBab good news 😃! Your original issue may now be fixed ✅ in PR #3887. This PR adds hyp['anchors']=3 if the anchors key is missing/commented in your hyperparameter file, fixing a long-running problem when starting hyp evolution using the default command:

python train.py --evolve

To receive this update:

  • Gitgit pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
  • PyTorch Hub – Force-reload with model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
  • Notebooks – View updated notebooks Open In Colab Open In Kaggle
  • Dockersudo docker pull ultralytics/yolov5:latest to update your image Docker Pulls

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 🚀!

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

Successfully merging a pull request may close this issue.

2 participants