Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ace19-dev committed Aug 8, 2019
1 parent 2285615 commit e5db632
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

flags.DEFINE_enum('learning_policy', 'poly', ['poly', 'step'],
'Learning rate policy for training.')
flags.DEFINE_float('base_learning_rate', 0.003,
flags.DEFINE_float('base_learning_rate', 0.002,
'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 All @@ -62,7 +62,7 @@
'Initialize the last layer.')
flags.DEFINE_boolean('last_layers_contain_logits_only', False,
'Only consider logits as last layers or not.')
flags.DEFINE_integer('slow_start_step', 686,
flags.DEFINE_integer('slow_start_step', 0,
'Training model with small learning rate for few steps.')
flags.DEFINE_float('slow_start_learning_rate', 0.0003,
'Learning rate employed during slow start.')
Expand All @@ -77,8 +77,8 @@
# None,
# 'Saved checkpoint path.')
flags.DEFINE_string('pre_trained_checkpoint',
# 'pre-trained/resnet_v2_50.ckpt',
None,
'pre-trained/resnet_v2_50.ckpt',
# None,
'The pre-trained checkpoint in tensorflow format.')
flags.DEFINE_string('checkpoint_exclude_scopes',
'resnet_v2_50/logits,resnet_v2_50/SpatialSqueeze,resnet_v2_50/predictions',
Expand Down
4 changes: 2 additions & 2 deletions utils/train_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def restore_fn(flags):
#
# Warn the user if a checkpoint exists in the train_dir. Then ignore.
# if tf.train.latest_checkpoint(flags.train_dir):
# tf.logging.info(
# tf.compat.v1.logging.info(
# 'Ignoring --checkpoint_path because a checkpoint already exists in %s'
# % flags.train_dir)
# return None
Expand Down Expand Up @@ -344,7 +344,7 @@ def restore_fn(flags):

slim.assign_from_checkpoint_fn(flags.pre_trained_checkpoint,
variables_to_restore)
tf.logging.info('Fine-tuning from %s. Ignoring missing vars: %s' %
tf.compat.v1.logging.info('Fine-tuning from %s. Ignoring missing vars: %s' %
(flags.pre_trained_checkpoint, flags.ignore_missing_vars))


Expand Down
10 changes: 5 additions & 5 deletions val_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ def augment(self, filename, image, label):
"""
# image = tf.image.central_crop(image, 0.9)
# image = tf.image.random_flip_up_down(image)
# image = tf.image.random_flip_left_right(image)
# image = tf.image.rot90(image, k=random.randint(0,4))
image = tf.image.random_flip_left_right(image)
image = tf.image.rot90(image, k=random.randint(0,4))
# paddings = tf.constant([[11, 11], [11, 11], [0, 0]]) # 224
# image = tf.pad(image, paddings, "CONSTANT")
image = tf.image.random_brightness(image, max_delta=1.1)
image = tf.image.random_contrast(image, lower=0.9, upper=1.1)
image = tf.image.random_brightness(image, max_delta=1.2)
image = tf.image.random_contrast(image, lower=0.8, upper=1.2)
# image = tf.image.random_hue(image, max_delta=0.04)
image = tf.image.random_saturation(image, lower=0.9, upper=1.1)
image = tf.image.random_saturation(image, lower=0.8, upper=1.2)
# image = tf.image.resize(image, [self.resize_h, self.resize_w])

return filename, image, label
Expand Down

0 comments on commit e5db632

Please sign in to comment.