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
f0505d26
Commit
f0505d26
authored
May 24, 2020
by
Jin Dong
Browse files
repeated cast
parent
0798c8ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
official/vision/image_classification/dataset_factory.py
official/vision/image_classification/dataset_factory.py
+1
-2
No files found.
official/vision/image_classification/dataset_factory.py
View file @
f0505d26
...
...
@@ -477,7 +477,7 @@ class DatasetBuilder:
parsed
=
tf
.
io
.
parse_single_example
(
record
,
keys_to_features
)
label
=
tf
.
reshape
(
parsed
[
'image/class/label'
],
shape
=
[
1
])
label
=
tf
.
cast
(
label
,
dtype
=
tf
.
int32
)
label
=
tf
.
cast
(
label
,
tf
.
int32
)
# Subtract one so that labels are in [0, 1000)
label
-=
1
...
...
@@ -507,7 +507,6 @@ class DatasetBuilder:
standardize
=
self
.
config
.
standardize
,
dtype
=
self
.
dtype
)
label
=
tf
.
cast
(
label
,
tf
.
int32
)
if
self
.
config
.
one_hot
:
label
=
tf
.
one_hot
(
label
,
self
.
num_classes
)
label
=
tf
.
reshape
(
label
,
[
self
.
num_classes
])
...
...
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