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
c4685e81
Unverified
Commit
c4685e81
authored
May 21, 2021
by
Vasilis Vryniotis
Committed by
GitHub
May 21, 2021
Browse files
Moving tensors to the right device (#3870)
* Moving tensors to the right device. * Switch to gpu.medium
parent
89cb9083
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
.circleci/config.yml
.circleci/config.yml
+1
-1
.circleci/config.yml.in
.circleci/config.yml.in
+1
-1
torchvision/models/detection/roi_heads.py
torchvision/models/detection/roi_heads.py
+1
-1
torchvision/transforms/functional_tensor.py
torchvision/transforms/functional_tensor.py
+2
-2
No files found.
.circleci/config.yml
View file @
c4685e81
...
@@ -661,7 +661,7 @@ jobs:
...
@@ -661,7 +661,7 @@ jobs:
<<
:
*binary_common
<<
:
*binary_common
machine
:
machine
:
image
:
ubuntu-1604-cuda-10.2:202012-01
image
:
ubuntu-1604-cuda-10.2:202012-01
resource_class
:
gpu.
small
resource_class
:
gpu.
nvidia.medium
environment
:
environment
:
image_name
:
"
pytorch/manylinux-cuda102"
image_name
:
"
pytorch/manylinux-cuda102"
PYTHON_VERSION
:
<< parameters.python_version >>
PYTHON_VERSION
:
<< parameters.python_version >>
...
...
.circleci/config.yml.in
View file @
c4685e81
...
@@ -661,7 +661,7 @@ jobs:
...
@@ -661,7 +661,7 @@ jobs:
<<: *binary_common
<<: *binary_common
machine:
machine:
image: ubuntu-1604-cuda-10.2:202012-01
image: ubuntu-1604-cuda-10.2:202012-01
resource_class: gpu.
small
resource_class: gpu.
nvidia.medium
environment:
environment:
image_name: "pytorch/manylinux-cuda102"
image_name: "pytorch/manylinux-cuda102"
PYTHON_VERSION: << parameters.python_version >>
PYTHON_VERSION: << parameters.python_version >>
...
...
torchvision/models/detection/roi_heads.py
View file @
c4685e81
...
@@ -274,7 +274,7 @@ def heatmaps_to_keypoints(maps, rois):
...
@@ -274,7 +274,7 @@ def heatmaps_to_keypoints(maps, rois):
xy_preds
[
i
,
0
,
:]
=
x
+
offset_x
[
i
]
xy_preds
[
i
,
0
,
:]
=
x
+
offset_x
[
i
]
xy_preds
[
i
,
1
,
:]
=
y
+
offset_y
[
i
]
xy_preds
[
i
,
1
,
:]
=
y
+
offset_y
[
i
]
xy_preds
[
i
,
2
,
:]
=
1
xy_preds
[
i
,
2
,
:]
=
1
end_scores
[
i
,
:]
=
roi_map
[
torch
.
arange
(
num_keypoints
),
y_int
,
x_int
]
end_scores
[
i
,
:]
=
roi_map
[
torch
.
arange
(
num_keypoints
,
device
=
roi_map
.
device
),
y_int
,
x_int
]
return
xy_preds
.
permute
(
0
,
2
,
1
),
end_scores
return
xy_preds
.
permute
(
0
,
2
,
1
),
end_scores
...
...
torchvision/transforms/functional_tensor.py
View file @
c4685e81
...
@@ -391,12 +391,12 @@ def _pad_symmetric(img: Tensor, padding: List[int]) -> Tensor:
...
@@ -391,12 +391,12 @@ def _pad_symmetric(img: Tensor, padding: List[int]) -> Tensor:
x_indices
=
[
i
for
i
in
range
(
in_sizes
[
-
1
])]
# [0, 1, 2, 3, ...]
x_indices
=
[
i
for
i
in
range
(
in_sizes
[
-
1
])]
# [0, 1, 2, 3, ...]
left_indices
=
[
i
for
i
in
range
(
padding
[
0
]
-
1
,
-
1
,
-
1
)]
# e.g. [3, 2, 1, 0]
left_indices
=
[
i
for
i
in
range
(
padding
[
0
]
-
1
,
-
1
,
-
1
)]
# e.g. [3, 2, 1, 0]
right_indices
=
[
-
(
i
+
1
)
for
i
in
range
(
padding
[
1
])]
# e.g. [-1, -2, -3]
right_indices
=
[
-
(
i
+
1
)
for
i
in
range
(
padding
[
1
])]
# e.g. [-1, -2, -3]
x_indices
=
torch
.
tensor
(
left_indices
+
x_indices
+
right_indices
)
x_indices
=
torch
.
tensor
(
left_indices
+
x_indices
+
right_indices
,
device
=
img
.
device
)
y_indices
=
[
i
for
i
in
range
(
in_sizes
[
-
2
])]
y_indices
=
[
i
for
i
in
range
(
in_sizes
[
-
2
])]
top_indices
=
[
i
for
i
in
range
(
padding
[
2
]
-
1
,
-
1
,
-
1
)]
top_indices
=
[
i
for
i
in
range
(
padding
[
2
]
-
1
,
-
1
,
-
1
)]
bottom_indices
=
[
-
(
i
+
1
)
for
i
in
range
(
padding
[
3
])]
bottom_indices
=
[
-
(
i
+
1
)
for
i
in
range
(
padding
[
3
])]
y_indices
=
torch
.
tensor
(
top_indices
+
y_indices
+
bottom_indices
)
y_indices
=
torch
.
tensor
(
top_indices
+
y_indices
+
bottom_indices
,
device
=
img
.
device
)
ndim
=
img
.
ndim
ndim
=
img
.
ndim
if
ndim
==
3
:
if
ndim
==
3
:
...
...
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