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
d38e8da1
"vscode:/vscode.git/clone" did not exist on "f6b59ae2820f1f314d0ed552f38bc40aec48ec2e"
Commit
d38e8da1
authored
Sep 23, 2022
by
Yeqing Li
Committed by
A. Unique TensorFlower
Sep 23, 2022
Browse files
Internal change
PiperOrigin-RevId: 476488291
parent
73e05832
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
official/vision/tasks/image_classification.py
official/vision/tasks/image_classification.py
+3
-0
No files found.
official/vision/tasks/image_classification.py
View file @
d38e8da1
...
...
@@ -338,6 +338,9 @@ class ImageClassificationTask(base_task.Task):
one_hot
=
self
.
task_config
.
losses
.
one_hot
soft_labels
=
self
.
task_config
.
losses
.
soft_labels
is_multilabel
=
self
.
task_config
.
train_data
.
is_multilabel
# Note: `soft_labels`` only apply to the training phrase. In the validation
# phrase, labels should still be integer ids and need to be converted to
# one hot format.
if
(
one_hot
or
soft_labels
)
and
not
is_multilabel
:
labels
=
tf
.
one_hot
(
labels
,
self
.
task_config
.
model
.
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