Can I just set the run name to the run ID?
Yes. To overwrite the run name with the run ID, use the following code snippet:
Yes. To overwrite the run name with the run ID, use the following code snippet:
For example, I want to log training accuracy per batch and validation accuracy per epoch.
If training occurs on an offline machine, use the following steps to upload results to the servers:
"Is the logging function lazy? I don't want to depend on the network to send results to your servers while executing local operations."
Yes, W&B uses the multiprocessing library. An error message like the following indicates a possible issue:
Pass a SHA or unique identifier to wandb.config.update(...) to associate a dataset with a training run. W&B stores no data unless wandb.save is called with the local file name.
The history object tracks metrics logged with wandb.log. Access the history object using the API:
Expand the image panel and use the step slider to navigate through images from different steps. This process facilitates comparison of a model's output changes during training.
At the beginning of the training script, call wandb.init with an experiment name. For example: wandb.init(name="myawesomerun").
The / character separates logged panels in the W&B UI. By default, the segment of the logged item's name before the / defines a group of panels known as a "Panel Section."
When wandb.init is invoked, the system automatically collects git information, including the remote repository link and the SHA of the latest commit. This information appears on the run page. Ensure the current working directory when executing the script is within a git-managed folder to view this information.
If a training program uses multiple processes, structure the program to avoid making wandb method calls from processes without wandb.init().
Direct integration of Plotly or Bokeh figures into tables is not supported. Instead, export the figures to HTML and include the HTML in the table. Below are examples demonstrating this with interactive Plotly and Bokeh charts.
Call wandb.run.save() to save the current run. Retrieve the name using wandb.run.name.
Use wandb.init and run.finish() to log multiple runs within a single script:
<Tabs
Create a multi-line custom chart with wandb.plot.lineseries(). Navigate to the project page to view the line chart. To add a legend, include the keys argument in wandb.plot.lineseries(). For example:
The .name attribute of a wandb.Run is accessible as follows:
If a run is not explicitly named, W&B assigns a random name to identify it in your project. Random names appear as "pleasant-flower-4" or "misunderstood-glade-2".
This error indicates that the library encounters an issue launching the process that synchronizes data to the server.
By default, wandb.init starts a process that syncs metrics in real time to the cloud. For offline use, set two environment variables to enable offline mode and sync later.
You likely lost connection to your machine during training. Recover data by running wandb sync [PATHTORUN]. The path to your run is a folder in your wandb directory that matches the Run ID of the ongoing run.
When wandb.init() runs in a training script, an API call creates a run object on the servers. A new process starts to stream and collect metrics, allowing the primary process to function normally. The script writes to local files while the separate process streams data to the servers, including system metrics. To turn off streaming, run wandb off from the training directory or set the WANDB_MODE environment variable to offline.
Avoid passing class attributes into wandb.log(). Attributes may change before the network call executes. When storing metrics as class attributes, use a deep copy to ensure the logged metric matches the attribute's value at the time of the wandb.log() call.
The number of points sent affects the loading time of graphs in the UI. For lines exceeding 1,000 points, the backend samples the data down to 1,000 points before sending it to the browser. This sampling is nondeterministic, resulting in different sampled points upon page refresh.
W&B supports projects that log only scalars by allowing explicit specification of files or data for upload. Refer to this example in PyTorch that demonstrates logging without using images.
To log specific metrics in each batch and standardize plots, log the desired x-axis values alongside the metrics. In the custom plots, click edit and select a custom x-axis.
Modes can be "online", "offline", or "disabled", with the default set to online.
When visualizing metrics against an X-axis other than Step, expect to see fewer data points. Metrics must log at the same Step to remain synchronized. Only metrics logged at the same Step are sampled while interpolating between samples.
If the message "No visualization data logged yet" appears, the script has not executed the first wandb.log call. This situation may occur if the run takes a long time to complete a step. To expedite data logging, log multiple times per epoch instead of only at the end.
When logging various data types under the same key, split them in the database. This results in multiple entries of the same metric name in the UI dropdown. The data types grouped are number, string, bool, other (primarily arrays), and any wandb data type such as Histogram or Image. Send only one type per key to prevent this issue.
W&B has a minimal impact on training performance under normal usage conditions. Normal use includes logging at a rate of less than once per second and limiting data to a few megabytes per step. W&B operates in a separate process with non-blocking function calls, ensuring that brief network outages or intermittent disk read/write issues do not disrupt performance. Excessive logging of large amounts of data may lead to disk I/O issues. For further inquiries, contact support.