When steps_per_execution is used, the step number shown by a progress bar does not match how many steps were actually executed.

See example here: colab

The step number does not match the number of optimizer iterations

Comment From: sonali-kumari1

Hi @itmo153277 -

Sorry for the delayed response.

  • steps_per_execution is the number of batches to run during each compiled function call and if it is set to N(10 in your case), callback methods like on_batch_end will only be called once every N batches.
  • The ProgbarLogger updates its display in on_train_batch_end method, so progress bar steps(1, 11, 21, ..) will be updated only after every N batches.
  • Optimizer iterations(10, 20, 30, ..) reflects total number of completed optimizer steps and corresponds to the cumulative number of batches processed.

I hope this helps. Thanks!

Comment From: github-actions[bot]

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

Comment From: itmo153277

@sonali-kumari1 I don't think that this is the desired behaviour. Because if ProgressBar shows 11 in actuality the model saw 20 batches which is very confusing, especially since normally you cannot see optimizer iterations directly. Also, if an epoch has 50 steps it will show 41 and then 50 with the same metric values (+validation). I think a proper implementation should show 10, 20, 30, 40, 50, 50 just like in Keras 2