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

Load Unet model in OpenCV? #41

Closed
kretep opened this issue Dec 12, 2022 · 3 comments
Closed

Load Unet model in OpenCV? #41

kretep opened this issue Dec 12, 2022 · 3 comments

Comments

@kretep
Copy link

kretep commented Dec 12, 2022

I'm trying to load a saved Unet model in OpenCV using dnn.readNetFromTensorflow and dnn.readNetFromONNX, but both methods are failing. The first one hangs and the second results in an obscure error.

> Node [Slice@ai.onnx]:(onnx_node!StatefulPartitionedCall/unet/crop_concat_block/strided_slice_6) parse error: OpenCV(4.6.0) /Users/xperience/actions-runner/_work/opencv-python/opencv-python/opencv/modules/dnn/src/onnx/onnx_importer.cpp:1345: error: (-215:Assertion failed) axes[i - 1] == axes[i] - 1 in function 'parseSlice'

Has anyone done this before?

@jakeret
Copy link
Owner

jakeret commented Dec 13, 2022

I haven't tried this before and I'm also unsure why it doesn't work. The CropConcatBlock is not doing anything special.

You could try to change the slicing of the down_layer. The last : is in principle not need

@kretep
Copy link
Author

kretep commented Dec 16, 2022

Thanks for your reply. Changing the slicing didn't help.

I dived into it a bit further and the issue seems to be in OpenCV. It looks like slicing is not properly processed in some cases: issue. It's already fixed, but not in a release yet. It works after building the dev version of OpenCV.

@kretep kretep closed this as completed Dec 16, 2022
@jakeret
Copy link
Owner

jakeret commented Dec 20, 2022

Thank you for digging into this. Hopefully it will be released soon

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

No branches or pull requests

2 participants