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
b7c0e5c6
"vscode:/vscode.git/clone" did not exist on "ec125053cd7f02f7a1d9d2bc5869cedc38a7e9fb"
Commit
b7c0e5c6
authored
Apr 03, 2020
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 304715282
parent
4456f249
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
official/benchmark/resnet_ctl_imagenet_benchmark.py
official/benchmark/resnet_ctl_imagenet_benchmark.py
+13
-3
No files found.
official/benchmark/resnet_ctl_imagenet_benchmark.py
View file @
b7c0e5c6
...
@@ -53,7 +53,8 @@ class CtlBenchmark(PerfZeroBenchmark):
...
@@ -53,7 +53,8 @@ class CtlBenchmark(PerfZeroBenchmark):
top_1_min
=
None
,
top_1_min
=
None
,
total_batch_size
=
None
,
total_batch_size
=
None
,
log_steps
=
None
,
log_steps
=
None
,
warmup
=
1
):
warmup
=
1
,
start_time_sec
=
None
):
"""Report benchmark results by writing to local protobuf file.
"""Report benchmark results by writing to local protobuf file.
Args:
Args:
...
@@ -64,6 +65,7 @@ class CtlBenchmark(PerfZeroBenchmark):
...
@@ -64,6 +65,7 @@ class CtlBenchmark(PerfZeroBenchmark):
total_batch_size: Global batch-size.
total_batch_size: Global batch-size.
log_steps: How often the log was created for stats['step_timestamp_log'].
log_steps: How often the log was created for stats['step_timestamp_log'].
warmup: number of entries in stats['step_timestamp_log'] to ignore.
warmup: number of entries in stats['step_timestamp_log'] to ignore.
start_time_sec: the start time of the program in seconds since epoch.
"""
"""
metrics
=
[]
metrics
=
[]
...
@@ -98,6 +100,12 @@ class CtlBenchmark(PerfZeroBenchmark):
...
@@ -98,6 +100,12 @@ class CtlBenchmark(PerfZeroBenchmark):
'value'
:
stats
[
'avg_exp_per_second'
]
'value'
:
stats
[
'avg_exp_per_second'
]
})
})
if
start_time_sec
and
'step_timestamp_log'
in
stats
:
time_log
=
stats
[
'step_timestamp_log'
]
# time_log[0] is recorded at the beginning of the first step.
startup_time
=
time_log
[
0
].
timestamp
-
start_time_sec
metrics
.
append
({
'name'
:
'startup_time'
,
'value'
:
startup_time
})
flags_str
=
flags_core
.
get_nondefault_flags_as_str
()
flags_str
=
flags_core
.
get_nondefault_flags_as_str
()
self
.
report_benchmark
(
self
.
report_benchmark
(
iters
=-
1
,
iters
=-
1
,
...
@@ -181,7 +189,8 @@ class Resnet50CtlAccuracy(CtlBenchmark):
...
@@ -181,7 +189,8 @@ class Resnet50CtlAccuracy(CtlBenchmark):
top_1_min
=
MIN_TOP_1_ACCURACY
,
top_1_min
=
MIN_TOP_1_ACCURACY
,
top_1_max
=
MAX_TOP_1_ACCURACY
,
top_1_max
=
MAX_TOP_1_ACCURACY
,
total_batch_size
=
FLAGS
.
batch_size
,
total_batch_size
=
FLAGS
.
batch_size
,
log_steps
=
100
)
log_steps
=
100
,
start_time_sec
=
start_time_sec
)
def
_get_model_dir
(
self
,
folder_name
):
def
_get_model_dir
(
self
,
folder_name
):
return
os
.
path
.
join
(
self
.
output_dir
,
folder_name
)
return
os
.
path
.
join
(
self
.
output_dir
,
folder_name
)
...
@@ -213,7 +222,8 @@ class Resnet50CtlBenchmarkBase(CtlBenchmark):
...
@@ -213,7 +222,8 @@ class Resnet50CtlBenchmarkBase(CtlBenchmark):
wall_time_sec
,
wall_time_sec
,
total_batch_size
=
FLAGS
.
batch_size
,
total_batch_size
=
FLAGS
.
batch_size
,
log_steps
=
FLAGS
.
log_steps
,
log_steps
=
FLAGS
.
log_steps
,
warmup
=
warmup
)
warmup
=
warmup
,
start_time_sec
=
start_time_sec
)
def
benchmark_1_gpu_no_dist_strat
(
self
):
def
benchmark_1_gpu_no_dist_strat
(
self
):
"""Test Keras model with 1 GPU, no distribution strategy."""
"""Test Keras model with 1 GPU, no distribution strategy."""
...
...
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