Run summary not displaying logged values with different step sizes

Hi all, I am trying to log losses and accuracy over iterations and epochs through the following code

for loop (training loop):
    wandb.log( {'train_loss_per_iter':loss.item(), 
 'train_acc_per_iter':100.*predicted.eq(targets).sum().item()/targets.size(0)}, step=batch_idx + epoch*(len(trainloader)+1) )                                                  
wandb.log({'train_loss_per_epoch': train_loss, 'train_acc_per_epoch': 100.*correct/total,}, step=epoch)

I would expect this to work, given that when you instead save the iterations in an array, the wandb will display the arrays for iterations in the plots for the run on the online wandb dashboard (however, it isn’t shown in the run summary shown on the command line).

however, the above method shown with code does not show the epoch level in the wandb website, nor does show the epoch level information in a run summary.

how can I make it so that, in order of priority:

  1. the relevant plots are shown for both iteration and epoch level on the online wandb website for the run?
  2. both iteration and epoch level summary are shown on the command line after run completion?

Hi @muawizc, we don’t allow writing to a step that is is < the current step. For example, logging to step 100 will make steps 0-99 unwritable.

To work around this you can use the define metric workflow shown here instead of plotting to a particular step, you can plot against another “metric” that you track yourself. In this case it would be the epoch. Metrics & Performance | Weights & Biases Documentation

Hi @muawizc

Since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!