Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
b9d2b1bb
Commit
b9d2b1bb
authored
Dec 03, 2018
by
Priya Gupta
Browse files
use v2 optimizer and dlr
parent
e932712b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
official/resnet/keras/keras_imagenet_main.py
official/resnet/keras/keras_imagenet_main.py
+4
-4
No files found.
official/resnet/keras/keras_imagenet_main.py
View file @
b9d2b1bb
...
@@ -250,11 +250,11 @@ def run_imagenet_with_keras(flags_obj):
...
@@ -250,11 +250,11 @@ def run_imagenet_with_keras(flags_obj):
# opt = tf.train.GradientDescentOptimizer(learning_rate=0.0001)
# opt = tf.train.GradientDescentOptimizer(learning_rate=0.0001)
# I am setting an initial LR of 0.001 since this will be reset
# I am setting an initial LR of 0.001 since this will be reset
# at the beginning of the training loop.
# at the beginning of the training loop.
#
opt = gradient_descent_v2.SGD(learning_rate=0.1, momentum=0.9)
opt
=
gradient_descent_v2
.
SGD
(
learning_rate
=
0.1
,
momentum
=
0.9
)
# TF Optimizer:
# TF Optimizer:
learning_rate
=
BASE_LEARNING_RATE
*
flags_obj
.
batch_size
/
256
#
learning_rate = BASE_LEARNING_RATE * flags_obj.batch_size / 256
opt
=
tf
.
train
.
MomentumOptimizer
(
learning_rate
=
learning_rate
,
momentum
=
0.9
)
#
opt = tf.train.MomentumOptimizer(learning_rate=learning_rate, momentum=0.9)
strategy
=
distribution_utils
.
get_distribution_strategy
(
strategy
=
distribution_utils
.
get_distribution_strategy
(
num_gpus
=
flags_obj
.
num_gpus
)
num_gpus
=
flags_obj
.
num_gpus
)
...
@@ -292,7 +292,7 @@ def run_imagenet_with_keras(flags_obj):
...
@@ -292,7 +292,7 @@ def run_imagenet_with_keras(flags_obj):
steps_per_epoch
=
steps_per_epoch
,
steps_per_epoch
=
steps_per_epoch
,
callbacks
=
[
callbacks
=
[
time_callback
,
time_callback
,
#
lr_callback,
lr_callback
,
tesorboard_callback
tesorboard_callback
],
],
verbose
=
1
)
verbose
=
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment