models icon indicating copy to clipboard operation
models copied to clipboard

Bug in models/official/resnet/cifar10_main.py when re-starting training

Open ybsave opened this issue 9 years ago • 2 comments

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.

ybsave avatar Sep 26 '17 18:09 ybsave

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])

scotthuang1989 avatar Sep 27 '17 08:09 scotthuang1989

It seems that I misunderstood the meaning of the parameters. Thanks for clarification.

ybsave avatar Sep 27 '17 15:09 ybsave