-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
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
Weights & Biases (W&B) Feature Addition #1235
Conversation
@AyushExel I noticed test.py imports wandb directly without a try statement. I'm surprised CI tests are passing like this, I would have thought this would produce an error. Will investigate. EDIT: the import is inside an if, perhaps this is the reason. |
@glenn-jocher It won't produce an error. If wandb is not installed |
@AyushExel I've done a general reorganization of the code:
|
@AyushExel I think I've completed all of my updates. Can you review and verify that I haven't broken anything inadvertently? This should work in multi-gpu now, but I will test today to verify. CI tests only run on CPU, single-GPU and multi-GPU testing is done by hand at the moment. |
@glenn-jocher I'm getting another error now:
Looking into this. |
Ah I see. This makes sense actually, as I placed .init() in an if opt.resume statement, so it will only initialize if resuming. I need to take it back out. I'll do that. |
Ahhh gotcha. Great catch. Thanks! |
All updates for this PR are complete. CI checks passing. Google colab example is working well. Will merge. |
Great! |
About Weights & BiasesThink of W&B like GitHub for machine learning models — save everything you need to debug, compare and reproduce your models — architecture, hyperparameters, weights, model predictions, GPU usage, git commits, and even datasets — with a few lines of code. W&B lightweight integrations work with any Python script, and all you need to do is sign up for a free W&B account to start tracking and visualizing your models. Used by the likes of OpenAI, Lyft, Github and researchers at top machine learning labs across the world, W&B is part of the new standard of best practices for machine learning. How W&B can help you optimize your machine learning workflows:
W&B is free for individuals, academics and open source projects. YOLOv5 with W&BHere's an in depth look at how the integration works: How are your yolov5 models doing? When training with |
* Add wandb metric logging and bounding box debugging * Improve formatting, readability * Remove mutliple path for init, improve formatting * Add wandb params * Remove typecasting in bbox coordinates and reformat * Cleanup * add wandb to requirements.txt * minor updates to test.py * general reorg * reduce --log-imgs to 10 * clean wandb import * reverse wandb import assert * add except AssertionError to try import * move wandb init to all global ranks * replace print() with logger.info() * replace print() with logger.info() * move wandb.init() bug fix * project PosixPath to basename bug fix Co-authored-by: Glenn Jocher <[email protected]>
* Add wandb metric logging and bounding box debugging * Improve formatting, readability * Remove mutliple path for init, improve formatting * Add wandb params * Remove typecasting in bbox coordinates and reformat * Cleanup * add wandb to requirements.txt * minor updates to test.py * general reorg * reduce --log-imgs to 10 * clean wandb import * reverse wandb import assert * add except AssertionError to try import * move wandb init to all global ranks * replace print() with logger.info() * replace print() with logger.info() * move wandb.init() bug fix * project PosixPath to basename bug fix Co-authored-by: Glenn Jocher <[email protected]>
* Add wandb metric logging and bounding box debugging * Improve formatting, readability * Remove mutliple path for init, improve formatting * Add wandb params * Remove typecasting in bbox coordinates and reformat * Cleanup * add wandb to requirements.txt * minor updates to test.py * general reorg * reduce --log-imgs to 10 * clean wandb import * reverse wandb import assert * add except AssertionError to try import * move wandb init to all global ranks * replace print() with logger.info() * replace print() with logger.info() * move wandb.init() bug fix * project PosixPath to basename bug fix Co-authored-by: Glenn Jocher <[email protected]>
What does this PR do?
This is a cleaned-up and updated version of this PR #1108 which adds W&B logging support.
Updates:
float
before passing them to the logging dictionary.Some of the import statement orders didn't pass through the PEP8 linter but these were not related to the changes I have made to I didn't edit them.
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Enhanced YOLOv5 logging with Weights & Biases integration for better experiment tracking and visualization 📈.
📊 Key Changes
wandb
) logging as a dependency inrequirements.txt
.test.py
to log images with predictions during testing.train.py
function signature to accept awandb
parameter for logging.wandb
logging intrain.py
to track experiments and log model performance metrics and hyperparameters.train.py
to set the number of images logged towandb
.🎯 Purpose & Impact
wandb
integration supports researchers and developers in tracking experiments, comparing results, and visualizing model performance more effectively.wandb
run ID in checkpoints allows users to continue logging from a specific point without starting a new logging instance, ensuring continuity in metric tracking.--log-imgs
command-line argument, tailoring the verbosity of visual logging to their needs.In summary, these updates will make it simpler for users to monitor, analyze, and share their YOLOv5 model training and testing processes, promoting more informed and iterative machine learning development. 🚀