Python openpose sample from openCV dnn does not run [closed]

asked 2018-04-27 06:07:49 -0600

moshel gravatar image

updated 2018-04-27 07:40:00 -0600

berak gravatar image

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?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2018-04-28 03:36:33.249467

Comments

1

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

berak gravatar imageberak ( 2018-04-27 06:28:51 -0600 )edit
1

@dkurt can probably help out here :)

StevenPuttemans gravatar imageStevenPuttemans ( 2018-04-27 07:16:26 -0600 )edit
1

@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)

berak gravatar imageberak ( 2018-04-27 07:42:50 -0600 )edit

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.

moshel gravatar imagemoshel ( 2018-04-27 16:46:12 -0600 )edit

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!

moshel gravatar imagemoshel ( 2018-04-27 17:47:55 -0600 )edit

stupid indeed!!!!! i had python-opencv installed now, to see if it works

moshel gravatar imagemoshel ( 2018-04-27 23:58:31 -0600 )edit

so, did it work ? (can we close this?)

berak gravatar imageberak ( 2018-04-28 01:27:03 -0600 )edit
2

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

moshel gravatar imagemoshel ( 2018-04-28 03:16:11 -0600 )edit
1

Currently running the samples in the dnn is a bit of a treasurehunt

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 !

berak gravatar imageberak ( 2018-04-28 03:36:17 -0600 )edit