Bug in models/official/resnet/cifar10_main.py when re-starting training
In file models/official/resnet/cifar10_main.py, there is the running cycle defined as:
for cycle in range(FLAGS.train_steps // FLAGS.steps_per_eval):
This cycle is not correct when training from an existing checkpoint but is only correct when training from scratch. I think the original intention for "FLAGS.train_steps" is the total number of training steps but not the steps needed for extra training; therefore, I believe that this is a bug.
I think the intention of "FLAGS.train_step" is the needed steps for this training. you can get that for following code, the FLAGS.steps_per_eval is pass to steps, there is another parameter: max_steps which refer to the total number of training steps.
cifar_classifier.train(
input_fn=lambda: input_fn(tf.estimator.ModeKeys.TRAIN,
batch_size=FLAGS.batch_size),
steps=FLAGS.steps_per_eval,
hooks=[logging_hook])
It seems that I misunderstood the meaning of the parameters. Thanks for clarification.