firephinx / openpose_ros

ROS Catkin package wrapper for the OpenPose library from https://github.com/CMU-Perceptual-Computing-Lab/openpose.
55 stars 44 forks source link

Runtime Error: Size(sourcePtrs) must match size(sourceSizes) and size(scaleInputToNetInputs) #5

Closed JunShern closed 6 years ago

JunShern commented 6 years ago

Hi! Thank you for your OpenPose ROS wrapper.

I am trying to get this working with a webcam, but I get the following runtime error when I do rosrun openpose_ros openpose_ros_node. My OpenPose installation can run the demo with no problem, and I am using OpenCV 3.2 with ROS Kinetic on Ubuntu 16.04. To get the webcam stream, I have tried using both the usb_cam and cv_camera packages but both give me the same error.

Starting pose estimation demo.
Auto-detecting GPUs... Detected 1 GPU(s), using them all.
Starting thread(s)
Starting thread(s)

Error:
Size(sourcePtrs) must match size(sourceSizes) and size(scaleInputToNetInputs). Currently: 2 vs. 2 vs. 1.

Coming from:
- /home/junshern/Scripts/openpose/src/openpose/core/resizeAndMergeBase.cu:resizeAndMergeGpu():74
- /home/junshern/Scripts/openpose/src/openpose/core/resizeAndMergeBase.cu:resizeAndMergeGpu():160
- /home/junshern/Scripts/openpose/src/openpose/core/resizeAndMergeCaffe.cpp:Forward_gpu():155
- /home/junshern/Scripts/openpose/src/openpose/pose/poseExtractorCaffe.cpp:forwardPass():302
- /home/junshern/Scripts/openpose/include/openpose/pose/wPoseExtractor.hpp:work():80
- /home/junshern/Scripts/openpose/include/openpose/thread/subThread.hpp:workTWorkers():135
- /home/junshern/Scripts/openpose/include/openpose/thread/subThreadQueueInOut.hpp:work():84
- /home/junshern/Scripts/openpose/include/openpose/thread/thread.hpp:threadFunction():203
terminate called after throwing an instance of 'std::runtime_error'
  what():  
Error:
Size(sourcePtrs) must match size(sourceSizes) and size(scaleInputToNetInputs). Currently: 2 vs. 2 vs. 1.

Coming from:
- /home/junshern/Scripts/openpose/src/openpose/core/resizeAndMergeBase.cu:resizeAndMergeGpu():74
- /home/junshern/Scripts/openpose/src/openpose/core/resizeAndMergeBase.cu:resizeAndMergeGpu():160
- /home/junshern/Scripts/openpose/src/openpose/core/resizeAndMergeCaffe.cpp:Forward_gpu():155
- /home/junshern/Scripts/openpose/src/openpose/pose/poseExtractorCaffe.cpp:forwardPass():302
- /home/junshern/Scripts/openpose/include/openpose/pose/wPoseExtractor.hpp:work():80
- /home/junshern/Scripts/openpose/include/openpose/thread/subThread.hpp:workTWorkers():135
- /home/junshern/Scripts/openpose/include/openpose/thread/subThreadQueueInOut.hpp:work():84
- /home/junshern/Scripts/openpose/include/openpose/thread/thread.hpp:threadFunction():203

Aborted (core dumped)

Any ideas why this might be happening?

Thank you!

ntalabot commented 6 years ago

Hi,

I started to have the same errors after updating OpenPose. After searching a bit, I found that, in openpose_ros/src/openpose_ros_node.cpp from line 99 to 103, there seems to be twice this piece of code:

op::log("Starting thread(s)", op::Priority::High);
opWrapper.start();

Commenting the repetition :

 99    op::log("Starting thread(s)", op::Priority::High);
100    opWrapper.start();
101
102    // op::log("Starting thread(s)", op::Priority::High);
103    // opWrapper.start();

seems to solve the problem (well, it did for me). However, I would be unable to explain in detail why, I'm new to OpenPose and its Wrapper.

Hope this helps :)

JunShern commented 6 years ago

AH that worked for me! Thank you so incredibly much, you're a life-saver!