Skip to content

Lightning `log-every-n-steps` and total number of batches

In some cases, I'm observing the following warning:

/Users/andre/mamba/envs/ptbench/lib/python3.11/site-packages/lightning/pytorch/loops/fit_loop.py:280: PossibleUserWarning: The number of training batches (22) is smaller than the logging interval Trainer(log_every_n_steps=50). Set a lower value for log_every_n_steps if you want to see logs for the training epoch.
  rank_zero_warn(

@dcarron: I wonder if we can't just set the lightning Trainer to fix this as suggested, automagically? Any ideas?