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
OpenDAS
vision
Commits
1706921b
Unverified
Commit
1706921b
authored
Nov 19, 2020
by
Vasilis Vryniotis
Committed by
GitHub
Nov 19, 2020
Browse files
Change reshape to support empty batches. (#3031)
parent
585ce2c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torchvision/models/detection/roi_heads.py
torchvision/models/detection/roi_heads.py
+1
-1
No files found.
torchvision/models/detection/roi_heads.py
View file @
1706921b
...
...
@@ -40,7 +40,7 @@ def fastrcnn_loss(class_logits, box_regression, labels, regression_targets):
sampled_pos_inds_subset
=
torch
.
where
(
labels
>
0
)[
0
]
labels_pos
=
labels
[
sampled_pos_inds_subset
]
N
,
num_classes
=
class_logits
.
shape
box_regression
=
box_regression
.
reshape
(
N
,
-
1
,
4
)
box_regression
=
box_regression
.
reshape
(
N
,
box_regression
.
size
(
-
1
)
//
4
,
4
)
box_loss
=
det_utils
.
smooth_l1_loss
(
box_regression
[
sampled_pos_inds_subset
,
labels_pos
],
...
...
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