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
0cc16aa5
Commit
0cc16aa5
authored
Apr 20, 2020
by
David Chen
Committed by
A. Unique TensorFlower
Apr 20, 2020
Browse files
Internal change
PiperOrigin-RevId: 307462714
parent
0d968ea2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
official/benchmark/keras_imagenet_benchmark.py
official/benchmark/keras_imagenet_benchmark.py
+7
-1
No files found.
official/benchmark/keras_imagenet_benchmark.py
View file @
0cc16aa5
...
...
@@ -320,6 +320,7 @@ class Resnet50KerasClassifierBenchmarkBase(keras_benchmark.KerasBenchmark):
top_1_min
:
float
=
MIN_TOP_1_ACCURACY
,
top_1_max
:
float
=
MAX_TOP_1_ACCURACY
,
num_gpus
:
int
=
0
,
num_tpus
:
int
=
0
,
distribution_strategy
:
str
=
'mirrored'
,
per_replica_batch_size
:
int
=
128
,
epochs_between_evals
:
int
=
1
,
...
...
@@ -350,7 +351,10 @@ class Resnet50KerasClassifierBenchmarkBase(keras_benchmark.KerasBenchmark):
dataset_num_private_threads
=
dataset_num_private_threads
,
loss_scale
=
loss_scale
)
FLAGS
.
params_override
=
json
.
dumps
(
parameters
)
total_batch_size
=
num_gpus
*
per_replica_batch_size
if
distribution_strategy
==
'tpu'
:
total_batch_size
=
num_tpus
*
per_replica_batch_size
else
:
total_batch_size
=
num_gpus
*
per_replica_batch_size
start_time_sec
=
time
.
time
()
stats
=
classifier_trainer
.
run
(
flags
.
FLAGS
)
...
...
@@ -610,6 +614,7 @@ class Resnet50KerasClassifierBenchmarkBase(keras_benchmark.KerasBenchmark):
self
.
_run_and_report_benchmark
(
experiment_name
=
'benchmark_2x2_tpu_fp16'
,
dtype
=
'bfloat16'
,
num_tpus
=
8
,
distribution_strategy
=
'tpu'
,
per_replica_batch_size
=
128
)
...
...
@@ -619,6 +624,7 @@ class Resnet50KerasClassifierBenchmarkBase(keras_benchmark.KerasBenchmark):
self
.
_run_and_report_benchmark
(
experiment_name
=
'benchmark_4x4_tpu_fp16'
,
dtype
=
'bfloat16'
,
num_tpus
=
32
,
distribution_strategy
=
'tpu'
,
per_replica_batch_size
=
128
)
...
...
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