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

--notest bug fix #518

Merged
merged 2 commits into from Jul 25, 2020
Merged

--notest bug fix #518

merged 2 commits into from Jul 25, 2020

Conversation

NanoCode012
Copy link
Contributor

@NanoCode012 NanoCode012 commented Jul 25, 2020

Command to replicate:

python train.py --weights yolov5s.pt --epochs 3 --img 320 --device 0 --notest

Mentioned in Issue #475 by @cesarandreslopez

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Optimization of model saving conditions during training in YOLOv5.

πŸ“Š Key Changes

  • Removed indentation, changing the scope of model evaluation and saving logic.
  • Adjusted the conditional logic for saving training results and updating the best model performance.

🎯 Purpose & Impact

  • Ensures consistent and accurate saving of the model's performance data after each training epoch.
  • Improves clarity of the training process, potentially leading to more reliable model saving and performance tracking for developers and users.
  • No new features or performance improvements, but a cleaner codebase can lead to fewer bugs and more straightforward maintenance.

@glenn-jocher
Copy link
Member

@NanoCode012 --notest is supposed to record all normal metrics even if it doesn't test. An empty results file is not the intended result.

reverting previous changes and  removing functionality from 'if not opt.notest or final_epoch:  # Calculate mAP' loop.
@glenn-jocher glenn-jocher changed the title Fix missing results_file and fi when notest passed --notest bug fix Jul 25, 2020
@NanoCode012
Copy link
Contributor Author

Ah, I see. Thanks for the fix!

@glenn-jocher
Copy link
Member

It looks like some commands were accidentally dropped an additional level into an if statement, so I've simply removed them back where they should be. I tested in the colab notebook and results.txt looks all good (attached).
results.txt

@glenn-jocher
Copy link
Member

glenn-jocher commented Jul 25, 2020

Looks like tests are passing. I'll merge. This should fix https://docs.ultralytics.com/yolov5/tutorials/multi_gpu_training.

@glenn-jocher glenn-jocher merged commit 7f8471e into ultralytics:master Jul 25, 2020
@NanoCode012 NanoCode012 deleted the patch-1 branch July 25, 2020 18:48
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 2021
* Fix missing results_file and fi when notest passed

* Update train.py

reverting previous changes and  removing functionality from 'if not opt.notest or final_epoch:  # Calculate mAP' loop.

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Fix missing results_file and fi when notest passed

* Update train.py

reverting previous changes and  removing functionality from 'if not opt.notest or final_epoch:  # Calculate mAP' loop.

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
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 this pull request may close these issues.

None yet

2 participants