Start logging with Accelerate
To get started with Accelerate and W&B you can follow the pseudocode below:- Pass
log_with="wandb"when initialising the Accelerator class - Call the
init_trackersmethod and pass it:
- a project name via
project_name - any parameters you want to pass to
wandb.init()via a nested dict toinit_kwargs - any other experiment config information you want to log to your wandb run, via
config
- Use the
.logmethod to log to Weigths & Biases; thestepargument is optional - Call
.end_trainingwhen finished training
Access the W&B tracker
To access the W&B tracker, use theAccelerator.get_tracker() method. Pass in the string corresponding to a tracker’s .name attribute, which returns the tracker on the main process.