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
78007443
Commit
78007443
authored
Jul 24, 2017
by
Xin Pan
Committed by
GitHub
Jul 24, 2017
Browse files
Merge pull request #2024 from naurril/master
Offset of image bytes for cifar100 should be 2
parents
703bcbab
a3b3220e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
resnet/cifar_input.py
resnet/cifar_input.py
+1
-1
No files found.
resnet/cifar_input.py
View file @
78007443
...
@@ -58,7 +58,7 @@ def build_input(dataset, data_path, batch_size, mode):
...
@@ -58,7 +58,7 @@ def build_input(dataset, data_path, batch_size, mode):
record
=
tf
.
reshape
(
tf
.
decode_raw
(
value
,
tf
.
uint8
),
[
record_bytes
])
record
=
tf
.
reshape
(
tf
.
decode_raw
(
value
,
tf
.
uint8
),
[
record_bytes
])
label
=
tf
.
cast
(
tf
.
slice
(
record
,
[
label_offset
],
[
label_bytes
]),
tf
.
int32
)
label
=
tf
.
cast
(
tf
.
slice
(
record
,
[
label_offset
],
[
label_bytes
]),
tf
.
int32
)
# Convert from string to [depth * height * width] to [depth, height, width].
# Convert from string to [depth * height * width] to [depth, height, width].
depth_major
=
tf
.
reshape
(
tf
.
slice
(
record
,
[
label_bytes
],
[
image_bytes
]),
depth_major
=
tf
.
reshape
(
tf
.
slice
(
record
,
[
label_offset
+
label_bytes
],
[
image_bytes
]),
[
depth
,
image_size
,
image_size
])
[
depth
,
image_size
,
image_size
])
# Convert from [depth, height, width] to [height, width, depth].
# Convert from [depth, height, width] to [height, width, depth].
image
=
tf
.
cast
(
tf
.
transpose
(
depth_major
,
[
1
,
2
,
0
]),
tf
.
float32
)
image
=
tf
.
cast
(
tf
.
transpose
(
depth_major
,
[
1
,
2
,
0
]),
tf
.
float32
)
...
...
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