Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ace19-dev committed Aug 9, 2019
1 parent d4c72b6 commit 22631d8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
FLAGS = flags.FLAGS

# Multi GPU - Must be a value of 1 or greater
flags.DEFINE_integer('num_gpu', 4, 'number of GPU')
flags.DEFINE_integer('num_gpu', 1, 'number of GPU')

flags.DEFINE_string('train_logdir', './tfmodels',
'Where the checkpoint and logs are stored.')
Expand All @@ -41,7 +41,7 @@

flags.DEFINE_enum('learning_policy', 'poly', ['poly', 'step'],
'Learning rate policy for training.')
flags.DEFINE_float('base_learning_rate', 0.002,
flags.DEFINE_float('base_learning_rate', 0.0003,
'The base learning rate for model training.')
flags.DEFINE_float('learning_rate_decay_factor', 1e-4,
'The rate to decay the base learning rate.')
Expand Down Expand Up @@ -103,8 +103,8 @@

flags.DEFINE_integer('how_many_training_epochs', 100,
'How many training loops to run')
flags.DEFINE_integer('batch_size', 256, 'batch size')
flags.DEFINE_integer('val_batch_size', 256, 'validation batch size')
flags.DEFINE_integer('batch_size', 32, 'batch size')
flags.DEFINE_integer('val_batch_size', 32, 'validation batch size')
flags.DEFINE_integer('height', 224, 'height')
flags.DEFINE_integer('width', 224, 'width')
# flags.DEFINE_string('labels',
Expand Down Expand Up @@ -186,8 +186,12 @@ def main(unused_argv):
FLAGS.slow_start_step, FLAGS.slow_start_learning_rate)
summaries.add(tf.compat.v1.summary.scalar('learning_rate', learning_rate))

# optimizers = \
# [tf.train.RMSPropOptimizer(learning_rate, decay=0.9, momentum=0.9) for _ in range(FLAGS.num_gpu)]
# optimizers = \
# [tf.compat.v1.train.MomentumOptimizer(learning_rate, FLAGS.momentum) for _ in range(FLAGS.num_gpu)]
optimizers = \
[tf.compat.v1.train.MomentumOptimizer(learning_rate, FLAGS.momentum) for _ in range(FLAGS.num_gpu)]
[tf.train.GradientDescentOptimizer(learning_rate) for _ in range(FLAGS.num_gpu)]

logits = []
losses = []
Expand Down

0 comments on commit 22631d8

Please sign in to comment.