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
6d140f13
Commit
6d140f13
authored
Aug 02, 2017
by
Neal Wu
Committed by
GitHub
Aug 02, 2017
Browse files
Merge pull request #2101 from mari-linhares/patch-9
Fixing style and typos
parents
4d543417
01122544
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
10 deletions
+5
-10
tutorials/image/cifar10_estimator/cifar10.py
tutorials/image/cifar10_estimator/cifar10.py
+0
-2
tutorials/image/cifar10_estimator/cifar10_main.py
tutorials/image/cifar10_estimator/cifar10_main.py
+3
-4
tutorials/image/cifar10_estimator/generate_cifar10_tfrecords.py
...als/image/cifar10_estimator/generate_cifar10_tfrecords.py
+2
-4
No files found.
tutorials/image/cifar10_estimator/cifar10.py
View file @
6d140f13
...
...
@@ -18,8 +18,6 @@ See http://www.cs.toronto.edu/~kriz/cifar.html.
"""
import
os
from
six.moves
import
xrange
# pylint: disable=redefined-builtin
import
tensorflow
as
tf
HEIGHT
=
32
...
...
tutorials/image/cifar10_estimator/cifar10_main.py
View file @
6d140f13
...
...
@@ -78,7 +78,7 @@ tf.flags.DEFINE_float('learning_rate', 0.1,
The learning rate will decrease during training.
For more details check the model_fn implementation
in this file.
"""
.
)
"""
)
tf
.
flags
.
DEFINE_boolean
(
'use_distortion_for_training'
,
True
,
'If doing image distortion for training.'
)
...
...
@@ -317,9 +317,8 @@ def _resnet_model_fn(features, labels, mode):
num_batches_per_epoch
*
x
for
x
in
np
.
array
([
82
,
123
,
300
],
dtype
=
np
.
int64
)
]
staged_lr
=
[
FLAGS
.
learning_rate
*
x
for
x
in
[
1
,
0.1
,
0.01
,
0.002
]]
staged_lr
=
[
FLAGS
.
learning_rate
*
x
for
x
in
[
1
,
0.1
,
0.01
,
0.002
]]
learning_rate
=
tf
.
train
.
piecewise_constant
(
tf
.
train
.
get_global_step
(),
boundaries
,
staged_lr
)
# Create a nicely-named tensor for logging
...
...
tutorials/image/cifar10_estimator/generate_cifar10_tfrecords.py
View file @
6d140f13
...
...
@@ -46,8 +46,7 @@ def _bytes_feature(value):
def
_get_file_names
():
"""Returns the file names expected to exist for training, validation
and evaluation in the input_dir."""
"""Returns the file names expected to exist in the input_dir."""
file_names
=
{}
file_names
[
'train'
]
=
[
'data_batch_%d'
%
i
for
i
in
xrange
(
1
,
5
)]
file_names
[
'validation'
]
=
[
'data_batch_5'
]
...
...
@@ -81,9 +80,8 @@ def convert_to_tfrecord(input_files, output_file):
record_writer
.
write
(
example
.
SerializeToString
())
record_writer
.
close
()
def
main
(
argv
):
del
argv
# Unused.
def
main
(
unused_argv
):
file_names
=
_get_file_names
()
for
mode
,
files
in
file_names
.
items
():
input_files
=
[
...
...
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