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

error of missing key 'anchors' in hyp.scratch.yaml #1744

Closed
sunsdy2018 opened this issue Dec 20, 2020 · 3 comments
Closed

error of missing key 'anchors' in hyp.scratch.yaml #1744

sunsdy2018 opened this issue Dec 20, 2020 · 3 comments
Labels
bug Something isn't working Stale

Comments

@sunsdy2018
Copy link

hi, thank you for providing yolo v5. I think I found a bug. The code branch was downloaded yesterday.
I run the code just as the link '#12' with the same data coco128.zip by using VS Code with Pytorch 1.7.1 and Conda and python 3.8.6 in Windows 10 professional.

  1. At line 20 in file hyp.scratch.yaml , it says '# anchors: 3 # anchors per output layer (0 to ignore)', which means the arg 'anchors' is commented and doesn't exist.
  2. However, in train.py, at line 541 "'anchors': (2, 2.0, 10.0), # anchors per output grid (0 to ignore)" , the key 'anchors' is not commented, and at line 591-593, there are 'hyp[k] = max(hyp[k], v[1])', 'hyp[k] = min(hyp[k], v[2])' and 'hyp[k] = round(hyp[k], 5)', hyp[k] is used in the right side.
  3. When running at line 191, error of missing key 'anchors' will occur.
@sunsdy2018 sunsdy2018 added the bug Something isn't working label Dec 20, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Dec 20, 2020

Hello @sunsdy2018, thank you for your interest in 🚀 YOLOv5! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

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 training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

glenn-jocher commented Dec 20, 2020

@sunsdy2018 sorry for the confusion. The anchors can be specified various ways:

  • in model.yaml as a list of anchors (i.e. as in yolov5s.yaml)
  • in model.yaml as an anchor count per output layer (i.e. anchors: 3)
  • in hyp.yaml as an anchor count per output layer (i.e. anchors: 3)

hyp.yaml anchor requests override model.yaml.

@github-actions
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

2 participants