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
7269b862
Commit
7269b862
authored
Aug 02, 2017
by
Marianne Linhares Monteiro
Committed by
GitHub
Aug 02, 2017
Browse files
Updating get_filenames to only use a single file
parent
32533a06
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
tutorials/image/cifar10_estimator/cifar10.py
tutorials/image/cifar10_estimator/cifar10.py
+5
-10
No files found.
tutorials/image/cifar10_estimator/cifar10.py
View file @
7269b862
...
...
@@ -39,15 +39,8 @@ class Cifar10DataSet(object):
self
.
use_distortion
=
use_distortion
def
get_filenames
(
self
):
if
self
.
subset
==
'train'
:
return
[
os
.
path
.
join
(
self
.
data_dir
,
'data_batch_%d.tfrecords'
%
i
)
for
i
in
xrange
(
1
,
5
)
]
elif
self
.
subset
==
'validation'
:
return
[
os
.
path
.
join
(
self
.
data_dir
,
'data_batch_5.tfrecords'
)]
elif
self
.
subset
==
'eval'
:
return
[
os
.
path
.
join
(
self
.
data_dir
,
'test_batch.tfrecords'
)]
if
self
.
subset
in
[
'train'
,
'validation'
,
'eval'
]:
return
[
os
.
path
.
join
(
self
.
data_dir
,
self
.
subset
+
'.tfrecords'
)]
else
:
raise
ValueError
(
'Invalid data subset "%s"'
%
self
.
subset
)
...
...
@@ -66,7 +59,9 @@ class Cifar10DataSet(object):
image
.
set_shape
([
DEPTH
*
HEIGHT
*
WIDTH
])
# Reshape from [depth * height * width] to [depth, height, width].
image
=
tf
.
transpose
(
tf
.
reshape
(
image
,
[
DEPTH
,
HEIGHT
,
WIDTH
]),
[
1
,
2
,
0
])
image
=
tf
.
cast
(
tf
.
transpose
(
tf
.
reshape
(
image
,
[
DEPTH
,
HEIGHT
,
WIDTH
]),
[
1
,
2
,
0
]),
tf
.
float32
)
label
=
tf
.
cast
(
features
[
'label'
],
tf
.
int32
)
# Custom preprocessing .
...
...
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