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

Python: bodypix model from tfjs: cannot create layer Minimum in getLayerInstance #17243

Closed
4 tasks done
diddledani opened this issue May 8, 2020 · 8 comments · Fixed by #17386
Closed
4 tasks done
Assignees
Milestone

Comments

@diddledani
Copy link

diddledani commented May 8, 2020

System information (version)
  • OpenCV => opencv_python-4.2.0.32 (inside a venv installed via pip) and also a version built from master (commit hash 0979940)
  • Operating System / Platform => Ubuntu 20.04 (amd64)
  • Compiler => N/A
Detailed description

The converted bodypix (mobilenet v2?) dnn model from tfjs loaded into opencv in python using cvNet = cv2.dnn.readNetFromTensorflow fails when calling cvNet.forward() with the following error:

Traceback (most recent call last):
  File "test-bodypix.py", line 7, in <module>
    results = cvNet.forward()
cv2.error: OpenCV(4.2.0) /io/opencv/modules/dnn/src/dnn.cpp:562: error: (-2:Unspecified error) Can't create layer "clip_by_value/Minimum" of type "Minimum" in function 'getLayerInstance'

Download URLs for original unconverted bodypix model.json files (I've also attached the converted model.pb that I am using below):

https://storage.googleapis.com/tfjs-models/savedmodel/bodypix/mobilenet/float/050/model-stride16.json
https://storage.googleapis.com/tfjs-models/savedmodel/bodypix/mobilenet/float/050/group1-shard1of1.bin

Steps to reproduce
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc
@dkurt
Copy link
Member

dkurt commented May 8, 2020

opencv_python-4.2.0.32

Please try the latest 4.3.0

@diddledani
Copy link
Author

diddledani commented May 8, 2020

I edited my post before you replied to indicate that I also tried master branch. Also note that 4.3.0 does not exist in the pypi.org package repository.

@dkurt
Copy link
Member

dkurt commented May 8, 2020

@diddledan, oh, sorry, just missed it. Thanks!

@dkurt dkurt added the feature label May 8, 2020
@diddledani
Copy link
Author

diddledani commented May 8, 2020

No problem - I figured I edited it after you'd loaded the page so it was unobvious :-)

@jtg-gg
Copy link

jtg-gg commented May 22, 2020

I am having the same issue, is there anyway to fix this ?

@jtg-gg
Copy link

jtg-gg commented May 23, 2020

image
I manage to draw the graph using tensor board. The Minimum / Maximum operation is actually at the very last operation for "float_parts_offsets"
@dkurt has implemented some graph transformation for fusing this into Relu6 ?
I am not sure why it isn't for this case

@dkurt
Copy link
Member

dkurt commented May 25, 2020

@l-bat, please take a look

@l-bat l-bat mentioned this issue May 26, 2020
6 tasks
@dkurt dkurt linked a pull request May 26, 2020 that will close this issue
6 tasks
@dkurt
Copy link
Member

dkurt commented May 26, 2020

Please test #17386 by @l-bat

@dkurt dkurt closed this as completed May 26, 2020
@alalek alalek added this to the 3.4.11 milestone May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

5 participants