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

One of the judgment criteria for line 267 in the val.py seems less rigorous #9400

Closed
1 of 2 tasks
JiannBai opened this issue Sep 13, 2022 · 3 comments · Fixed by #9431
Closed
1 of 2 tasks

One of the judgment criteria for line 267 in the val.py seems less rigorous #9400

JiannBai opened this issue Sep 13, 2022 · 3 comments · Fixed by #9431
Labels
bug Something isn't working

Comments

@JiannBai
Copy link

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

No response

Bug

Maybe not a bug, when I was in the verification phase of the last epoch, if I didn't have a true positive, it would be wrong on line 294 under the "if plot" condition

Environment

No response

Minimal Reproducible Example

if len(stats) and stats[0].any():
tp, fp, p, r, f1, ap, ap_class = ap_per_class(*stats, plot=plots, save_dir=save_dir, names=names)
ap50, ap = ap[:, 0], ap.mean(1) # AP@0.5, AP@0.5:0.95
mp, mr, map50, map = p.mean(), r.mean(), ap50.mean(), ap.mean()

if plots:
confusion_matrix.plot(save_dir=save_dir, names=list(names.values()))
callbacks.run('on_val_end', nt, tp, fp, p, r, f1, ap, ap50, ap_class, confusion_matrix)

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@JiannBai JiannBai added the bug Something isn't working label Sep 13, 2022
@glenn-jocher
Copy link
Member

@jianbaiwuqing your code is likely out of date as val.py L294 is an empty line:

yolov5/val.py

Lines 290 to 294 in 1323b48

# Plots
if plots:
confusion_matrix.plot(save_dir=save_dir, names=list(names.values()))
callbacks.run('on_val_end', nt, tp, fp, p, r, f1, ap, ap50, ap_class, confusion_matrix)

If you are able to reproduce this in master please provide a minimum reproducible example so we can start debugging. Thanks!

glenn-jocher added a commit that referenced this issue Sep 15, 2022
Resolves #9400

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher
Copy link
Member

@jianbaiwuqing I'm able to reproduce an error by setting --conf 1.0. Working on a fix in #9431

glenn-jocher added a commit that referenced this issue Sep 15, 2022
Resolves #9400

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher
Copy link
Member

@jianbaiwuqing good news 😃! Your original issue may now be fixed ✅ in PR #9431. To receive this update:

  • Gitgit pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
  • PyTorch Hub – Force-reload 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
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants