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
3060b534
Commit
3060b534
authored
Dec 07, 2018
by
Priya Gupta
Browse files
Add validation every epoch. Remove random seed setting. Change logging frequency
parent
59788849
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
official/resnet/keras/keras_imagenet_main.py
official/resnet/keras/keras_imagenet_main.py
+5
-12
No files found.
official/resnet/keras/keras_imagenet_main.py
View file @
3060b534
...
@@ -189,15 +189,6 @@ def run_imagenet_with_keras(flags_obj):
...
@@ -189,15 +189,6 @@ def run_imagenet_with_keras(flags_obj):
Raises:
Raises:
ValueError: If fp16 is passed as it is not currently supported.
ValueError: If fp16 is passed as it is not currently supported.
"""
"""
# Set all random seeds to fixed values.
import
random
import
numpy
as
np
seed
=
87654321
random
.
seed
(
seed
)
np
.
random
.
seed
(
seed
)
tf
.
random
.
set_random_seed
(
seed
)
dtype
=
flags_core
.
get_tf_dtype
(
flags_obj
)
dtype
=
flags_core
.
get_tf_dtype
(
flags_obj
)
if
dtype
==
'fp16'
:
if
dtype
==
'fp16'
:
raise
ValueError
(
'dtype fp16 is not supported in Keras. Use the default '
raise
ValueError
(
'dtype fp16 is not supported in Keras. Use the default '
...
@@ -276,8 +267,8 @@ def run_imagenet_with_keras(flags_obj):
...
@@ -276,8 +267,8 @@ def run_imagenet_with_keras(flags_obj):
time_callback
=
TimeHistory
(
flags_obj
.
batch_size
)
time_callback
=
TimeHistory
(
flags_obj
.
batch_size
)
tesorboard_callback
=
tf
.
keras
.
callbacks
.
TensorBoard
(
tesorboard_callback
=
tf
.
keras
.
callbacks
.
TensorBoard
(
log_dir
=
flags_obj
.
model_dir
,
log_dir
=
flags_obj
.
model_dir
)
update_freq
=
"batch"
)
# Add this if want per batch logging.
#
update_freq="batch") # Add this if want per batch logging.
lr_callback
=
LearningRateBatchScheduler
(
lr_callback
=
LearningRateBatchScheduler
(
learning_rate_schedule
,
learning_rate_schedule
,
...
@@ -295,6 +286,8 @@ def run_imagenet_with_keras(flags_obj):
...
@@ -295,6 +286,8 @@ def run_imagenet_with_keras(flags_obj):
lr_callback
,
lr_callback
,
tesorboard_callback
tesorboard_callback
],
],
validation_steps
=
num_eval_steps
,
validation_data
=
eval_input_dataset
,
verbose
=
1
)
verbose
=
1
)
eval_output
=
model
.
evaluate
(
eval_input_dataset
,
eval_output
=
model
.
evaluate
(
eval_input_dataset
,
...
@@ -308,6 +301,6 @@ def main(_):
...
@@ -308,6 +301,6 @@ def main(_):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
tf
.
logging
.
set_verbosity
(
tf
.
logging
.
DEBUG
)
tf
.
logging
.
set_verbosity
(
tf
.
logging
.
INFO
)
imagenet_main
.
define_imagenet_flags
()
imagenet_main
.
define_imagenet_flags
()
absl_app
.
run
(
main
)
absl_app
.
run
(
main
)
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