Python openpose sample from openCV dnn does not run [closed]
I have installed opencv-master from scratch, got the openpose model and prototext according to an answer to another question here, used the command line:
python openpose.py --model pose_iter_440000.caffemodel --proto openpose_pose_coco.prototxt --dataset COCO --width 300 --height 300
and got:
[ INFO:0] Initialize OpenCL runtime...
OpenCV Error: Assertion failed (output_slice.isContinuous() && output_slice.size == curr_output.size) in fuseLayers, file /io/opencv/modules/dnn/src/dnn.cpp, line 1430
Traceback (most recent call last):
File "openpose.py", line 68, in <module>
out = net.forward()
cv2.error: /io/opencv/modules/dnn/src/dnn.cpp:1430: error: (-215) output_slice.isContinuous() && output_slice.size == curr_output.size in function fuseLayers
What am I doing wrong?
it won't change the error (could reproduce it), but width and height should be 368, not 300.
btw, c++ version of it runs fine.
oh wait, my python is still on 3.4.0
@dkurt can probably help out here :)
@moshel are you sure, you use latest master ? line number does not match (but it does match the non-working 3.4.0 version)
try a
cv.__version__
(i'm somewhat suspecting, you're still using a previous 3.4.0 version, which cannot handle openpose)
ummmm it does seems like 3.4.0. I have just cloned the master branch from github. I am now Downloading and compiling 3.4.1. I thought the way to get the "cutting edge" version was to go to the main github page, clikc the "clone or download" and download from there... obviously I was wrong....
Thank you all for looking into this - I will report if it worked after the compilation.
i have re-downloaded 3.4.1 (the branch), compiled, sudo make install, verified the /usr/local/lib libraries are actually .so.3.4.1 and still the version gives me 3.4.0!!! I have also sudo ldconfig, even wend the extra length and deleted all libraries with the opencv prefix and reinstalled and it is still 3.4.0. I am sure it is something really stupid but I just can't figure it out!
stupid indeed!!!!! i had python-opencv installed now, to see if it works
so, did it work ? (can we close this?)
Yes it worked! thanks! What would be the best way of contributing to the documentation? Currently running the samples in the dnn is a bit of a treasurehunt . You have to match the programs to the pretrained datasets (even if you managed to find the download script, it fails in the middle and doesn't tell you which model goes to which example). I can either write a blog, add to the readme or the wiki? what would be the best approach
yes, indeed. the wiki is locked (dev access only), but if you can improve the readme, i'd think, that's quite welcome.
writing some blog posts is ofc. nice, too !