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
01cc8df9
Commit
01cc8df9
authored
Nov 14, 2019
by
Will Cromar
Committed by
A. Unique TensorFlower
Nov 14, 2019
Browse files
Internal change
PiperOrigin-RevId: 280532315
parent
3fab0abd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
official/vision/image_classification/README.md
official/vision/image_classification/README.md
+2
-2
official/vision/image_classification/resnet_ctl_imagenet_main.py
...l/vision/image_classification/resnet_ctl_imagenet_main.py
+17
-0
No files found.
official/vision/image_classification/README.md
View file @
01cc8df9
...
...
@@ -139,7 +139,7 @@ python resnet_ctl_imagenet_main.py \
--use_synthetic_data
=
false
\
--dtype
=
fp32
\
--enable_eager
=
true
\
--enable_tensorboard
=
fals
e
\
--enable_tensorboard
=
tru
e
\
--distribution_strategy
=
tpu
\
--log_steps
=
50
\
--single_l2_loss_op
=
true
\
...
...
@@ -159,7 +159,7 @@ python resnet_ctl_imagenet_main.py \
--use_synthetic_data
=
false
\
--dtype
=
fp32
\
--enable_eager
=
true
\
--enable_tensorboard
=
fals
e
\
--enable_tensorboard
=
tru
e
\
--distribution_strategy
=
tpu
\
--log_steps
=
50
\
--single_l2_loss_op
=
true
\
...
...
official/vision/image_classification/resnet_ctl_imagenet_main.py
View file @
01cc8df9
...
...
@@ -331,6 +331,11 @@ def run(flags_obj):
train_single_step
=
tf
.
function
(
train_single_step
)
test_step
=
tf
.
function
(
test_step
)
if
flags_obj
.
enable_tensorboard
:
summary_writer
=
tf
.
summary
.
create_file_writer
(
flags_obj
.
model_dir
)
else
:
summary_writer
=
None
train_iter
=
iter
(
train_ds
)
time_callback
.
on_train_begin
()
for
epoch
in
range
(
train_epochs
):
...
...
@@ -371,7 +376,19 @@ def run(flags_obj):
test_accuracy
.
result
().
numpy
(),
epoch
+
1
)
if
summary_writer
:
current_steps
=
steps_in_current_epoch
+
(
epoch
*
per_epoch_steps
)
with
summary_writer
.
as_default
():
tf
.
summary
.
scalar
(
'train_loss'
,
train_loss
.
result
(),
current_steps
)
tf
.
summary
.
scalar
(
'train_accuracy'
,
training_accuracy
.
result
(),
current_steps
)
tf
.
summary
.
scalar
(
'eval_loss'
,
test_loss
.
result
(),
current_steps
)
tf
.
summary
.
scalar
(
'eval_accuracy'
,
test_accuracy
.
result
(),
current_steps
)
time_callback
.
on_train_end
()
if
summary_writer
:
summary_writer
.
close
()
eval_result
=
None
train_result
=
None
...
...
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