Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onnx upsample #100

Merged
merged 3 commits into from
Sep 3, 2020
Merged

Onnx upsample #100

merged 3 commits into from
Sep 3, 2020

Conversation

drcut
Copy link
Contributor

@drcut drcut commented Aug 28, 2020

As ONNX does not support using nn.Upsample, we have to use our customized Upsample Module which is a simple wrapper of F.interpolate.
Besides, pytorch2onnx.py does not support models with multiple decode heads (like ocrnet), we support these models in this version.

Fixed #97

@codecov
Copy link

codecov bot commented Aug 28, 2020

Codecov Report

Merging #100 into master will decrease coverage by 0.02%.
The diff coverage is 82.60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #100      +/-   ##
==========================================
- Coverage   81.97%   81.95%   -0.03%     
==========================================
  Files          76       76              
  Lines        3467     3485      +18     
  Branches      529      537       +8     
==========================================
+ Hits         2842     2856      +14     
- Misses        522      524       +2     
- Partials      103      105       +2     
Flag Coverage Δ
#unittests 81.95% <82.60%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmseg/ops/wrappers.py 82.75% <80.00%> (-8.16%) ⬇️
mmseg/models/backbones/hrnet.py 84.30% <100.00%> (ø)
mmseg/ops/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 597b8a6...3cf6101. Read the comment docs.


class Upsample(nn.Module):

def __init__(self, scale_factor, mode, align_corners):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may also support size.

@hellock hellock merged commit 0c04f52 into open-mmlab:master Sep 3, 2020
@dzyjjpy
Copy link

dzyjjpy commented Nov 4, 2020

@drcut @hellock when convert onnx, I met another issue related.
I can convert hrnet's pytorch's model to onnx(tmp.onnx); --verify shows that: outputs between tmp.onnx and pytorch model have no difference.
But I can't convert tmp.onnx to coreml。 It shows issue about resize op(upsample op)

@dzyjjpy
Copy link

dzyjjpy commented Nov 4, 2020

tmp.zip
here is the converted onnx

bowenroom pushed a commit to bowenroom/mmsegmentation that referenced this pull request Feb 25, 2022
* add customized Upsample which can convert to ONNX

* support multiply decode head for hrnet

* support size for Upsample
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
wjkim81 pushed a commit to wjkim81/mmsegmentation that referenced this pull request Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pytorch2onnx script run failed !
4 participants