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

opWrapper.emplaceAndPop([datum]) crashing #1718

Closed
kthkpc opened this issue Oct 12, 2020 · 9 comments
Closed

opWrapper.emplaceAndPop([datum]) crashing #1718

kthkpc opened this issue Oct 12, 2020 · 9 comments
Assignees
Labels

Comments

@kthkpc
Copy link

kthkpc commented Oct 12, 2020

I've noticed that when I try to run openpose for more than one image in a loop or using live feed webcam, the code tends to stall and crashes when it reaches opWrapper.emplaceAndPop([datum]). After reading the documentations, this function calls the following two functions:

  1. opWrapper.waitAndEmplace([datum])
  2. opWrapper.waitAndPop([datum])

I've tried using these functions instead and the same issue occurs. It seems that the crash occurs when I try to waitAndPop the datum as when I run only the waitAndEmplace in a while loop, it will run about 70 times before crashing given that I assume its because the queue is full. Is there a way to solve this issue or would you perhaps know any reason why this might be the case?

@soulslicer
Copy link
Collaborator

soulslicer commented Nov 8, 2020

Can you give me a sample python code that i can run to fix it

@lonelygoatherd
Copy link

Hi, have you solved this problem? I meet a problem kind of like this. I run the examples in tutorial_api_python folder and the single gpu examples run well but multi_gpu examples raise error as below:
Starting OpenPose Python Wrapper...
waitAndEmplace(): incompatible function arguments. The following argument types are supported:
1. (self: openpose.pyopenpose.WrapperPython, arg0: std::vector<std::shared_ptrop::Datum, std::allocator<std::shared_ptrop::Datum > >) -> bool

Invoked with: <openpose.pyopenpose.WrapperPython object at 0x7fbcdb0aae30>, [<openpose.pyopenpose.Datum object at 0x7fbcdb0aab30>]

Did you forget to #include <pybind11/stl.h>? Or <pybind11/complex.h>,
<pybind11/functional.h>, <pybind11/chrono.h>, etc. Some automatic
conversions are optional and require extra headers to be included
when compiling your pybind11 module.

@mainstring
Copy link

Same problem here.
Ubunutu 18.04
Tried with both Cuda 10.2 and 11.1
Cudnn 7.5

@soulslicer
Copy link
Collaborator

I'll be looking into this issue next week. The code examples were running fine the last time I tested about a few months ago

@lonelygoatherd
Copy link

lonelygoatherd commented Nov 20, 2020 via email

@Pinocchioo
Copy link
Contributor

Pinocchioo commented Nov 21, 2020

Hi, have you solved this problem? I meet a problem kind of like this. I run the examples in tutorial_api_python folder and the single gpu examples run well but multi_gpu examples raise error as below:
Starting OpenPose Python Wrapper...
waitAndEmplace(): incompatible function arguments. The following argument types are supported:

  1. (self: openpose.pyopenpose.WrapperPython, arg0: std::vector<std::shared_ptrop::Datum, std::allocator<std::shared_ptrop::Datum > >) -> bool

Invoked with: <openpose.pyopenpose.WrapperPython object at 0x7fbcdb0aae30>, [<openpose.pyopenpose.Datum object at 0x7fbcdb0aab30>]

Did you forget to #include <pybind11/stl.h>? Or <pybind11/complex.h>,
<pybind11/functional.h>, <pybind11/chrono.h>, etc. Some automatic
conversions are optional and require extra headers to be included
when compiling your pybind11 module.

Hi, have you solved this problem ? I also met this problem in latest openpose V1.7 from git downloading. Now this problem has been solved, after I downloaded the v1.6 relsaseed version of the openpose.
So I think the official examples have some wrong place in latest openpose_python_api example_09.

@kthkpc
Copy link
Author

kthkpc commented Dec 2, 2020

Hey, I found a mistake in my own code yesterday. I changed 'waitAndEmpalce([datum]) to  'waitAndEmpalce(op.VectorDatum([datum])). It works but I can't understand why some official python api examples use '[datum]' and some need to add 'op.VectorDatum'.

------------------ 原始邮件 ------------------ 发件人: "Raaj"<notifications@github.com>; 发送时间: 2020年11月19日(星期四) 晚上10:08 收件人: "CMU-Perceptual-Computing-Lab/openpose"<openpose@noreply.github.com>; 抄送: "武少广"<434658267@qq.com>; "Comment"<comment@noreply.github.com>; 主题: Re: [CMU-Perceptual-Computing-Lab/openpose] opWrapper.emplaceAndPop([datum]) crashing (#1718) I'll be looking into this issue next week. The code examples were running fine the last time I tested about a few months ago — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

I also received the same issue and tried using opWrapper.emplaceAndPop(op.VectorDatum([datum]), it builds but when I run it it would say the following:

AttributeError: 'numpy.ndarray' object has no attribute 'VectorDatum'

I tried saving a frame and it seems that its able to provide and place the keypoints once but then it would run into the error mentioned afterwards. Did any one of you encountered the same problem?

@soulslicer
Copy link
Collaborator

Hi can you guys provide me a code snippet to run that is causing your issues? I have run all the existing samples and they appear to work

@soulslicer
Copy link
Collaborator

@lonelygoatherd Yes you are suppose to use the following syntax:

datum = op.Datum()
imageToProcess = cv2.imread(imagePath)
datum.cvInputData = imageToProcess
opWrapper.emplaceAndPop(op.VectorDatum([datum]))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants