Skip to content

Commit

Permalink
update the calculation of num_batches_per_epoch
Browse files Browse the repository at this point in the history
the number of batches per epoch also depends on the number of gpus. it should be `num_batches_per_epoch = (cifar10.NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN / FLAGS.batch_size / FLAGS.num_gpus)`
  • Loading branch information
cheerss authored Nov 1, 2018
1 parent 82e783e commit c803290
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tutorials/image/cifar10/cifar10_multi_gpu_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def train():

# Calculate the learning rate schedule.
num_batches_per_epoch = (cifar10.NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN /
FLAGS.batch_size)
FLAGS.batch_size / FLAGS.num_gpus)
decay_steps = int(num_batches_per_epoch * cifar10.NUM_EPOCHS_PER_DECAY)

# Decay the learning rate exponentially based on the number of steps.
Expand Down

0 comments on commit c803290

Please sign in to comment.