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
e96f2d5c
Unverified
Commit
e96f2d5c
authored
Mar 16, 2020
by
Negin Raoof
Committed by
GitHub
Mar 16, 2020
Browse files
Fix for roi_align export (#1988)
parent
2875315d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
torchvision/ops/_register_onnx_ops.py
torchvision/ops/_register_onnx_ops.py
+4
-2
No files found.
torchvision/ops/_register_onnx_ops.py
View file @
e96f2d5c
...
...
@@ -18,8 +18,10 @@ def _register_custom_op():
nms_out
=
g
.
op
(
'NonMaxSuppression'
,
boxes
,
scores
,
max_output_per_class
,
iou_threshold
)
return
squeeze
(
g
,
select
(
g
,
nms_out
,
1
,
g
.
op
(
'Constant'
,
value_t
=
torch
.
tensor
([
2
],
dtype
=
torch
.
long
))),
1
)
@
parse_args
(
'v'
,
'v'
,
'f'
,
'i'
,
'i'
,
'i'
)
def
roi_align
(
g
,
input
,
rois
,
spatial_scale
,
pooled_height
,
pooled_width
,
sampling_ratio
):
@
parse_args
(
'v'
,
'v'
,
'f'
,
'i'
,
'i'
,
'i'
,
'i'
)
def
roi_align
(
g
,
input
,
rois
,
spatial_scale
,
pooled_height
,
pooled_width
,
sampling_ratio
,
aligned
):
if
(
aligned
):
raise
RuntimeError
(
'Unsupported: ONNX export of roi_align with aligned'
)
batch_indices
=
_cast_Long
(
g
,
squeeze
(
g
,
select
(
g
,
rois
,
1
,
g
.
op
(
'Constant'
,
value_t
=
torch
.
tensor
([
0
],
dtype
=
torch
.
long
))),
1
),
False
)
rois
=
select
(
g
,
rois
,
1
,
g
.
op
(
'Constant'
,
value_t
=
torch
.
tensor
([
1
,
2
,
3
,
4
],
dtype
=
torch
.
long
)))
...
...
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