deep-learninggoogle-colaboratorywandb

what is wandb in Google Colab and why do we use it?


here is the screenshot from google colab I was preparing a YOLOv9 model. And i saw this wandb stuff. But as I remember there were no wand warnings a few months ago. I don't get the difference of using wandb or not.

Can someone explain?

I just waited for the time is up. I didn't choose any of 3 options.


Solution

  • Short answer

    if you don't need it just hit option 3.

    Longer answer

    WandB (weights and biases) is a really cool tool for live visuals of data. Essentially you can log data as something like a training loop runs, and each iteration of the loop (i.e. each time the log function is called) it will update a plot in real time. The plots are accessible via a web UI, which the api key it's asking for in the screenshot will be associated with your account/project.

    In the initialization phase of the yolo model you're running, there will be something that looks like this to initialize weights and biases. When this is called it'll either search for an environment variable WANDB_API_KEY or prompt you with the message you see to enter it.

    wandb.init(project=wandb_project_name], name=argumentswandb_run_name)
    

    In the training loop you will see a call to wand.log with a dictionary in it such as wandb.log({'plot': data}) where plot is the key of the dictionary which will be the name of the plot if you log into weights and biases, and data is whatever data is being logged (on the y axis).

    Here is an example from a GAN project I have:

    wandb.log({
        "avg_norm_jsd": avg_jsd,
        "fitness_fn": fitness,
        "selection_interval_marker": subset_sel_time
    }, step=epoch_idx) # step is how many units on the x axis along this next point should be
    

    If you don't need visualization, don't worry about it just hit option 3 to skip all use of wandb. If you need any visuals I highly recommend it, as you can also sort and group different training runs together in the same plots.

    If you want to try using it just create an account, make a new project, and then it should generate an api key for you. You should only need to paste it in the terminal when prompted once, or alternatively set an environment variable.