wandb.init
Last updated
Last updated
Start a new tracked run with wandb.init()
.
In an ML training pipeline, you could add wandb.init()
to the beginning of your training script as well as your evaluation script, and each piece would be tracked as a run in W&B.
wandb.init()
spawns a new background process to log data to a run, and it also syncs data to wandb.ai by default so you can see live visualizations. Call wandb.init()
to start a run before logging data with wandb.log()
.
wandb.init()
returns a run object, and you can also access the run object with wandb.run.
Arguments | |
| (str, optional) The name of the project where you're sending the new run. If the project is not specified, the run is put in an "Uncategorized" project. |
| (str, optional) An entity is a username or team name where you're sending runs. This entity must exist before you can send runs there, so make sure to create your account or team in the UI before starting to log runs. If you don't specify an entity, the run will be sent to your default entity, which is usually your username. Change your default entity in Settings under "default location to create new projects". |
| (dict, argparse, absl.flags, str, optional) This sets wandb.config, a dictionary-like object for saving inputs to your job, like hyperparameters for a model or settings for a data preprocessing job. The config will show up in a table in the UI that you can use to group, filter, and sort runs. Keys should not contain |
| (bool, optional) Turn this on to save the main script or notebook to W&B. This is valuable for improving experiment reproducibility and to diff code across experiments in the UI. By default this is off, but you can flip the default behavior to on in Settings. |
| (str, optional) Specify a group to organize individual runs into a larger experiment. For example, you might be doing cross validation, or you might have multiple jobs that train and evaluate a model against different test sets. Group gives you a way to organize runs together into a larger whole, and you can toggle this on and off in the UI. For more details, see Grouping. |
| (str, optional) Specify the type of run, which is useful when you're grouping runs together into larger experiments using group. For example, you might have multiple jobs in a group, with job types like train and eval. Setting this makes it easy to filter and group similar runs together in the UI so you can compare apples to apples. |
| (list, optional) A list of strings, which will populate the list of tags on this run in the UI. Tags are useful for organizing runs together, or applying temporary labels like "baseline" or "production". It's easy to add and remove tags in the UI, or filter down to just runs with a specific tag. |
| (str, optional) A short display name for this run, which is how you'll identify this run in the UI. By default we generate a random two-word name that lets you easily cross-reference runs from the table to charts. Keeping these run names short makes the chart legends and tables easier to read. If you're looking for a place to save your hyperparameters, we recommend saving those in config. |
| (str, optional) A longer description of the run, like a -m commit message in git. This helps you remember what you were doing when you ran this run. |
| (str, optional) An absolute path to a directory where metadata will be stored. When you call |
| (bool, str, optional) Sets the resuming behavior. Options: |
| (bool, optional) Allow multiple |
| (bool, dict, or str, optional) The bool controls whether we try to auto-instrument your script, capturing basic details of your run without you having to add more wandb code. (default: |
| (list, optional) string keys to exclude from |
| (list, optional) string keys to include in |
| (str, optional) Controls anonymous data logging. Options: - |
| (str, optional) Can be |
| (bool, optional) Whether to allow config values to change after setting the keys once. By default we throw an exception if a config value is overwritten. If you want to track something like a varying learning rate at multiple times during training, use |
| (bool, optional) If |
| (bool, optional) Synchronize wandb logs from tensorboard or tensorboardX and saves the relevant events file. (default: |
| (bool, optional) Automatically logs videos of environment when using OpenAI Gym. (default: |
| (str, optional) A unique ID for this run, used for resuming. It must be unique in the project, and if you delete a run you can't reuse the ID. Use the name field for a short descriptive name, or config for saving hyperparameters to compare across runs. The ID cannot contain special characters. See https://docs.wandb.com/library/resuming |
Basic usage
Launch multiple runs from the same script
Raises | |
| if problem. |
Returns | |
A |