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
45df923a
Commit
45df923a
authored
Aug 03, 2022
by
Liangzhe Yuan
Committed by
A. Unique TensorFlower
Aug 03, 2022
Browse files
Internal change
PiperOrigin-RevId: 465156306
parent
09f5b83a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
official/vision/tasks/video_classification.py
official/vision/tasks/video_classification.py
+4
-4
No files found.
official/vision/tasks/video_classification.py
View file @
45df923a
...
@@ -283,9 +283,9 @@ class VideoClassificationTask(base_task.Task):
...
@@ -283,9 +283,9 @@ class VideoClassificationTask(base_task.Task):
# Computes per-replica loss.
# Computes per-replica loss.
if
self
.
_is_multilabel
():
if
self
.
_is_multilabel
():
outputs
=
tf
.
math
.
sigmoid
(
outputs
)
outputs
=
tf
.
nest
.
map_structure
(
tf
.
math
.
sigmoid
,
outputs
)
else
:
else
:
outputs
=
tf
.
math
.
softmax
(
outputs
)
outputs
=
tf
.
nest
.
map_structure
(
tf
.
math
.
softmax
,
outputs
)
all_losses
=
self
.
build_losses
(
all_losses
=
self
.
build_losses
(
model_outputs
=
outputs
,
labels
=
labels
,
aux_losses
=
model
.
losses
)
model_outputs
=
outputs
,
labels
=
labels
,
aux_losses
=
model
.
losses
)
loss
=
all_losses
[
self
.
loss
]
loss
=
all_losses
[
self
.
loss
]
...
@@ -354,9 +354,9 @@ class VideoClassificationTask(base_task.Task):
...
@@ -354,9 +354,9 @@ class VideoClassificationTask(base_task.Task):
"""Performs the forward step."""
"""Performs the forward step."""
outputs
=
model
(
features
,
training
=
False
)
outputs
=
model
(
features
,
training
=
False
)
if
self
.
_is_multilabel
():
if
self
.
_is_multilabel
():
outputs
=
tf
.
math
.
sigmoid
(
outputs
)
outputs
=
tf
.
nest
.
map_structure
(
tf
.
math
.
sigmoid
,
outputs
)
else
:
else
:
outputs
=
tf
.
math
.
softmax
(
outputs
)
outputs
=
tf
.
nest
.
map_structure
(
tf
.
math
.
softmax
,
outputs
)
num_test_views
=
self
.
_get_num_test_views
()
num_test_views
=
self
.
_get_num_test_views
()
if
num_test_views
>
1
:
if
num_test_views
>
1
:
# Averaging output probabilities across multiples views.
# Averaging output probabilities across multiples views.
...
...
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