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
BackgroundSubtractorMOG2 apply calls from python causes allocation error #6055
Comments
Please provide a short script using the data shipped with OpenCV that replicates your error so that it can be debugged. |
The following code produces the error on my system:
I'm running it on CentOS 6, when I run it on a separate CentOS 7 system the error isn't produced. (The CentOS 7 system is also using python 2.7.5, with GCC 4.8.5 (i'm not sure if this is used)). The error first appeared after changing to OpenCV-3.1 and does not occur with OpenCV-3.0.0 (with either system). |
I can't replicate this error on my Ubuntu, Windows or OSX machines for either Python 2.7.11 or 3.5. Did you compile OpenCV 3.1 yourself? |
I have same error. I compiled opencv 3.1 myself, OSX, Python 3.5. cmake output attached. |
Thanks @anatolix your cmake helped a lot - it seems like the issue is related to OpenCL support. I can't replicate the error with OpenCL off, but with OpenCL on I get a segmentation fault (on OSX). Given the other error I fixed, I feel like it has to do with this line, which I'm guessing should be looking for a |
I can confirm that after editing CMakeCache.txt to set WITH_OPENCL.. flags to OFF and rebuilding, the error disappears. |
Same error here. Python 2.7, most recent opencv windows (10) binary. Anyway to get around this without recompiling with cmake? Just want to check before i head down that road. I can't comment out a line (other offered solution) without recompiling, correct? Would going to python 3 and redownloading latest opencv windows binary be worth a shot? |
@bw4sz Seems like binaries compiled with OpenCL support are broken - so if the latest Windows binaries have OpenCL support you will still see this error (it is independent of Python version it seems). |
|
Confirming building from source worked. Thanks. |
The simpler workaround that could work is to disable OpenCL in runtime by |
Error message:
This appears to be a similar bug as #5667 for knnMatch, however the fix for that bug doesn't apply here
The bug seems to be related to an allocate call. It seems to be avoided for python3 and some people just disable the warning link, however it would be better to identify the problem (eg for python 2) and prevent it occurring.
The text was updated successfully, but these errors were encountered: