Only warn about running out of data when `steps_per_epoch` was set (#23360)