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
da1d3e60
Unverified
Commit
da1d3e60
authored
Feb 22, 2019
by
Dong Lin
Committed by
GitHub
Feb 22, 2019
Browse files
Set data_dir to cifar-10-batches-bin in keras_cifar_benchmark.py (#6251)
parent
21a4ad75
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
official/resnet/keras/keras_cifar_benchmark.py
official/resnet/keras/keras_cifar_benchmark.py
+14
-13
official/resnet/resnet_run_loop.py
official/resnet/resnet_run_loop.py
+5
-1
No files found.
official/resnet/keras/keras_cifar_benchmark.py
View file @
da1d3e60
...
...
@@ -31,6 +31,7 @@ MIN_TOP_1_ACCURACY = 0.925
MAX_TOP_1_ACCURACY
=
0.938
FLAGS
=
flags
.
FLAGS
CIFAR_DATA_DIR_NAME
=
'cifar-10-batches-bin'
class
Resnet56KerasAccuracy
(
keras_benchmark
.
KerasBenchmark
):
...
...
@@ -47,7 +48,7 @@ class Resnet56KerasAccuracy(keras_benchmark.KerasBenchmark):
named arguments before updating the constructor.
"""
self
.
data_dir
=
os
.
path
.
join
(
root_data_dir
,
'cifar-10-batches-bin'
)
self
.
data_dir
=
os
.
path
.
join
(
root_data_dir
,
CIFAR_DATA_DIR_NAME
)
flag_methods
=
[
keras_common
.
define_keras_flags
,
cifar_main
.
define_cifar_flags
]
...
...
@@ -210,25 +211,25 @@ class Resnet56KerasBenchmarkSynth(Resnet56KerasBenchmarkBase):
"""Synthetic benchmarks for ResNet56 and Keras."""
def
__init__
(
self
,
output_dir
=
None
,
root_data_dir
=
None
,
**
kwargs
):
def_flags
=
{}
def_flags
[
'skip_eval'
]
=
True
def_flags
[
'use_synthetic_data'
]
=
True
def_flags
[
'train_steps'
]
=
110
def_flags
[
'log_steps'
]
=
10
def
ault
_flags
=
{}
def
ault
_flags
[
'skip_eval'
]
=
True
def
ault
_flags
[
'use_synthetic_data'
]
=
True
def
ault
_flags
[
'train_steps'
]
=
110
def
ault
_flags
[
'log_steps'
]
=
10
super
(
Resnet56KerasBenchmarkSynth
,
self
).
__init__
(
output_dir
=
output_dir
,
default_flags
=
def_flags
)
output_dir
=
output_dir
,
default_flags
=
def
ault
_flags
)
class
Resnet56KerasBenchmarkReal
(
Resnet56KerasBenchmarkBase
):
"""Real data benchmarks for ResNet56 and Keras."""
def
__init__
(
self
,
output_dir
=
None
,
root_data_dir
=
None
,
**
kwargs
):
def_flags
=
{}
def_flags
[
'skip_eval'
]
=
True
def_flags
[
'data_dir'
]
=
self
.
data_dir
def_flags
[
'train_steps'
]
=
110
def_flags
[
'log_steps'
]
=
10
def
ault
_flags
=
{}
def
ault
_flags
[
'skip_eval'
]
=
True
def
ault
_flags
[
'data_dir'
]
=
os
.
path
.
join
(
root_data_dir
,
CIFAR_DATA_DIR_NAME
)
def
ault
_flags
[
'train_steps'
]
=
110
def
ault
_flags
[
'log_steps'
]
=
10
super
(
Resnet56KerasBenchmarkReal
,
self
).
__init__
(
output_dir
=
output_dir
,
default_flags
=
def_flags
)
output_dir
=
output_dir
,
default_flags
=
def
ault
_flags
)
official/resnet/resnet_run_loop.py
View file @
da1d3e60
...
...
@@ -588,6 +588,10 @@ def resnet_main(
int
(
n_loops
))
if
num_train_epochs
:
# Since we are calling classifier.train immediately in each loop, the
# value of num_train_epochs in the lambda function will not be changed
# before it is used. So it is safe to ignore the pylint error here
# pylint: disable=cell-var-from-loop
classifier
.
train
(
input_fn
=
lambda
:
input_fn_train
(
num_train_epochs
),
hooks
=
train_hooks
,
max_steps
=
flags_obj
.
max_train_steps
)
...
...
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