MaochengHu 576cda45b8 first commit | před 2 roky | |
---|---|---|
.. | ||
README.md | před 2 roky | |
__init__.py | před 2 roky | |
log_dataset.py | před 2 roky | |
sweep.py | před 2 roky | |
sweep.yaml | před 2 roky | |
wandb_utils.py | před 2 roky |
📚 This guide explains how to use Weights & Biases (W&B) with YOLOv5 🚀. UPDATED 29 September 2021.
Think of W&B like GitHub for machine learning models. With a few lines of code, save everything you need to debug, compare and reproduce your models — architecture, hyperparameters, git commits, model weights, GPU usage, and even datasets and predictions.
Used by top researchers including teams at OpenAI, Lyft, Github, and MILA, 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:
Toggle Details
When you first train, W&B will prompt you to create a new account and will generate an API key for you. If you are an existing user you can retrieve your key from https://wandb.ai/authorize. This key is used to tell W&B where to log your data. You only need to supply your key once, and then it is remembered on the same device.
W&B will create a cloud project (default is 'YOLOv5') for your training runs, and each new training run will be provided a unique run name within that project as project/name. You can also manually set your project and run name as:
$ python train.py --project ... --name ...
Toggle Details
Run information streams from your environment to the W&B cloud console as you train. This allows you to monitor and even cancel runs in realtime . All important information is logged:
You can leverage W&B artifacts and Tables integration to easily visualize and manage your datasets, models and training evaluations. Here are some quick examples to get you started.
1: Train and Log Evaluation simultaneousy
This is an extension of the previous section, but it'll also training after uploading the dataset. This also evaluation Table
Evaluation table compares your predictions and ground truths across the validation set for each epoch. It uses the references to the already uploaded datasets,
so no images will be uploaded from your system more than once.
Usage
Code $ python train.py --upload_data val
{dataset}_wandb.yaml
file which can be used to train from dataset artifact.
$ python utils/logger/wandb/log_dataset.py --project ... --name ... --data ..
_wandb
to its name. This file contains the information that
can be used to train a model directly from the dataset artifact. This also logs evaluation
$ python train.py --data {data}_wandb.yaml
--save_period n
with the base cammand, where n
represents checkpoint interval.
You can also log both the dataset and model checkpoints simultaneously. If not passed, only the final model will be logged
Usage
Code $ python train.py --save_period 1
--resume
argument starts with wandb-artifact://
prefix followed by the run path, i.e, wandb-artifact://username/project/runid
. This doesn't require the model checkpoint to be present on the local system.
Usage
Code $ python train.py --resume wandb-artifact://{run_path}
--upload_dataset
or
train from _wandb.yaml
file and set --save_period
Usage
Code $ python train.py --resume wandb-artifact://{run_path}
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
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), validation (val.py), inference (detect.py) and export (export.py) on macOS, Windows, and Ubuntu every 24 hours and on every commit.