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

ERROR : error using imPadMex #42

Open
purva98 opened this issue Jun 15, 2018 · 6 comments
Open

ERROR : error using imPadMex #42

purva98 opened this issue Jun 15, 2018 · 6 comments

Comments

@purva98
Copy link

purva98 commented Jun 15, 2018

Error using imPadMex
Requested 137438953888x512x7598263500303858035 (17179869184.0GB) array exceeds maximum array size
preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become
unresponsive. See array size limit or preference panel for more information.

Error in imPad (line 39)
J = imPadMex( I, pad, type );

Error in edgesDetect (line 52)
I = imPad(I,p,'symmetric');

Error in edgesDemo (line 25)
tic, E=edgesDetect(I,model); toc

@weixuansun
Copy link

I got exactly same error here, is there any solutions?

@byjiang1996
Copy link

Me too...

@jmbuena
Copy link

jmbuena commented Jul 10, 2018

Hi,

I don't know exactly about your errors, but it seems the same error we fixed with:
Push Request: #38.

This errors are related to a recent change in Matlab in the mex types (Matlab 2017?). In the P. Dollar code they are hardcoded to C++ types. In my fix I changed this types to Matlab C++ types, and then everything works.

On the other hand, I don't know exactly if in your case it would be fixed with the Push Request, but I bet if not, the fix would be similar.

@MysteryVaibhav
Copy link

I am not able to resolve this issue. If I just pull the code and try to run the mex commands, I get the following error:


mex private/edgesDetectMex.cpp -outdir private CXXFLAGS="$CXXFLAGS -fopenmp" LDFLAGS="$LDFLAGS -fopenmp"
Building with 'g++'.
Error using mex
edges/private/edgesDetectMex.cpp: In function ‘void mexFunction(int, mxArray**, int, const mxArray**)’:
edges/private/edgesDetectMex.cpp:99:63: error: cannot convert ‘const int*’ to ‘const size_t* {aka const long unsigned int*}’
for argument ‘2’ to ‘mxArray* mxCreateNumericArray(size_t, const size_t*, mxClassID, mxComplexity)’
pl[0] = mxCreateNumericArray(3,outDims,mxSINGLE_CLASS,mxREAL);
^
edges/private/edgesDetectMex.cpp:101:63: error: cannot convert ‘const int*’ to ‘const size_t* {aka const long unsigned int*}’
for argument ‘2’ to ‘mxArray* mxCreateNumericArray(size_t, const size_t*, mxClassID, mxComplexity)’
pl[1] = mxCreateNumericArray(3,indDims,mxUINT32_CLASS,mxREAL);
^
edges/private/edgesDetectMex.cpp:103:71: error: cannot convert ‘const int*’ to ‘const size_t* {aka const long unsigned int*}’
for argument ‘2’ to ‘mxArray* mxCreateNumericArray(size_t, const size_t*, mxClassID, mxComplexity)’
if(nl>2) pl[2] = mxCreateNumericArray(5,segDims,mxUINT8_CLASS,mxREAL);
^


If I change the types from const int to const size_t or const mwSize, then the mex code compiles successfully with some warnings.

But then when I try to use the edgeBoxes(img, model, opts) function, I get the same error as mentioned in the issue.


Error using imPadMex
Requested 137438953888x512x7598263500303858035 (17179869184.0GB) array exceeds maximum array size


If anyone found a solution to this then please share. I am not sure if this is a version compatibility issue, I am using a 64-bit Linux machine with Matlab2017b.

@ngonthier
Copy link

ngonthier commented Sep 17, 2018

I have the same error with Matlab2017b on 64-bit Linux machine.

@zchrissirhcz
Copy link

this error is caused by mwSize type. mwSize is equivalent to int in C when <= matlab2016b.
However, from matlab2017b, mwSize is equivalent to size_t. On 64bit system, int is 32bit, and size_t is 64bit.

raaghavchaudhry1 pushed a commit to raaghavchaudhry1/MLV_toolbox that referenced this issue Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants