Skip to content

Fix problems with loading ONNX networks with parametrized inputs#18145

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
sl-sergei:fix_17914
Nov 17, 2020
Merged

Fix problems with loading ONNX networks with parametrized inputs#18145
opencv-pushbot merged 1 commit intoopencv:3.4from
sl-sergei:fix_17914

Conversation

@sl-sergei
Copy link
Copy Markdown
Contributor

@sl-sergei sl-sergei commented Aug 20, 2020

resolves #17914 and #18072
merge with extra: opencv/opencv_extra#798

Current limitations for fix: Expand, Shape and ConstantFill layers are not supported, since their parameters use constBlobs, which are not accessible during allocation of layers memory

There is a problem with loading ONNX networks with input shapes denoted by some string parameter (e.g. "width", "height"). It seems that OpenCV parser replaces these parameters to zeroes by default.
image

One of the examples is MaskRCNN in #17914 . I believe that converting from PyTorch to ONNX with "dynamic_axes" will produce the same issues.

Xopencv_extra=named_params_onnx

force_builders=Custom,Custom Win,Custom Mac
build_image:Custom=ubuntu-openvino-2021.1.0:20.04
build_image:Custom Win=openvino-2021.1.0
build_image:Custom Mac=openvino-2021.1.0

test_modules:Custom=dnn,python2,python3,java
test_modules:Custom Win=dnn,python2,python3,java
test_modules:Custom Mac=dnn,python2,python3,java

buildworker:Custom=linux-1
# disabled due high memory usage: test_opencl:Custom=ON
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

@sl-sergei
Copy link
Copy Markdown
Contributor Author

@alalek Can you please check test Layer_Test_Slice.slice_channels_and_batch_17762 ? My changes should not affect this test case at all, but anyway it fails on MYRIAD device

@sl-sergei sl-sergei requested a review from dkurt October 15, 2020 19:07
@sl-sergei
Copy link
Copy Markdown
Contributor Author

@dkurt Can you please review the changes? Also, I think I need your help with some tests on Custom machines. For some reason, there are failed cases on MYRIAD/CPU with DLIE, even though some of them are not related to my code (for example, Layer_Test_Slice.slice_channels_and_batch_17762). I can't reproduce it locally on my machine, maybe you have any ideas about failed tests.

@sl-sergei sl-sergei changed the title WIP: Fix problems with loading ONNX networks with parametrized inputs Fix problems with loading ONNX networks with parametrized inputs Nov 16, 2020
@sl-sergei sl-sergei force-pushed the fix_17914 branch 2 times, most recently from 2edc42d to 00ab83f Compare November 16, 2020 11:59
@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 16, 2020

BTW, avoid using #N in commit messages. This causes creation of false cross-links on GitHub.

@sl-sergei
Copy link
Copy Markdown
Contributor Author

BTW, avoid using #N in commit messages. This causes creation of false cross-links on GitHub.

thank you!

@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 16, 2020

Ignore this ABI error. It belongs to experimental namespace
I will filter out that on CI later (there is a bug in filter code).

vtable ABI issue is hard to resolve (usually it is done through dynamic_cast, but this requires the closed list of "derived" classes)

@sl-sergei sl-sergei requested review from dkurt and removed request for dkurt November 16, 2020 18:40
@sl-sergei
Copy link
Copy Markdown
Contributor Author

Ignore this ABI error. It belongs to experimental namespace
I will filter out it on CI later.

vtable ABI issue is hard to resolve (usually it is done through dynamic_cast, but this requires the closed list of "derived" classes)

Thanks! Is there some article/wiki page about such details of OpenCV's CI configuration? I am asking just for the future work, so there will be less problems like this

@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 16, 2020

ABI checks are not intended to be configured externally. It is a part of Buildbot configuration (updates require restart, GitHub code may be a bit outdated).

https://github.com/opencv/opencv/wiki/CI-configuration

@JulienMaille
Copy link
Copy Markdown
Contributor

@sl-sergei Could you check if these added onnx do pass with this PR?
opencv/opencv_extra#816

@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 17, 2020

@sl-sergei Please squash commits and rebase on latest 3.4 branch

@sl-sergei sl-sergei force-pushed the fix_17914 branch 3 times, most recently from d245084 to ad0fbf4 Compare November 17, 2020 10:31
@sl-sergei
Copy link
Copy Markdown
Contributor Author

@dkurt friendly reminder

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

LGTM

@opencv-pushbot opencv-pushbot merged commit 4f3130f into opencv:3.4 Nov 17, 2020
@alalek alalek mentioned this pull request Nov 17, 2020
@alalek alalek mentioned this pull request Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants