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 while running edgesDemo.m #26

Closed
crasse2 opened this issue Jul 27, 2018 · 7 comments
Closed

error while running edgesDemo.m #26

crasse2 opened this issue Jul 27, 2018 · 7 comments

Comments

@crasse2
Copy link

crasse2 commented Jul 27, 2018

Hi there !

first thanks pdollar for sharing your work, the results are astonishing !

however i'm new to matlab and I got some problems trying to make it work :

I did everything carefully in the installation method but then when I try to run edgesDemo.m I got this error :

Error using imPadMex
Requested 137438953888x1726576853504x7598263500303858035 (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.

and several others but they come from the first one I think

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

As I said i'm quite new to matlab and didn't find yet where this imPadMex error does come from, any help would be greatly appreciated.

@crasse2
Copy link
Author

crasse2 commented Jul 29, 2018

re,

sorry, in fact I managed to get it working simply by downgrading to Matlab 2016 (I was using the 2017) and everything works like a charm ! (again I tried it on several images and the results are awesome for lines/edges extraction, thanks for sharing your work !)

@crasse2 crasse2 closed this as completed Jul 29, 2018
@Passagers123a
Copy link

Passagers123a commented Nov 14, 2018

I have met the same question,and I use the MATLAB type is R2018a.Could you means I need to change the Matlab to 2016?

@Passagers123a
Copy link

I have changed. But I face the same qusetions as R2018 and you faced ever. Could you tell me how to solve the problem?

@zchrissirhcz
Copy link

zchrissirhcz commented Jan 3, 2019

@crasse2 @Passagers123a

After some debugging, I figure it out that mwSize type is defined differently:

  • int in C, when matlab<=2016b
  • size_t in C, i.e. long unsigned int, when matlab>=2017a

Since I'm using ubuntu16.04 x64_64, on which the default gcc compiler is 64bit, and:

sizeof(int) = 4
sizeof(mwSize) = 8

thus, it would make wrong result if we still casting an array of mwSize to array of int. By carefully modify variable types, I made edgesDemo.m works correctly in matlab2017b as in matlab2016b with original code.

By the way, I've pushed my modified version to github:

edges

toolbox

however, I do not guarantee other functions work correctly on matlab2017b or higher.

@OdedHorowits
Copy link

OdedHorowits commented Jan 8, 2019

@zchrissirhcz
Thank you very much for your work.

Please note that the fixed 'toolbox' must be mexed before the fixed 'edges', otherwise you run into troubles with the demos (getting 'Undefined function or variable 'edgesDetectMex'.' error).

In addition, please notice to 'add the path and its subfolders' of the toolbox and the edges-toolbox, otherwise you will get another error.

But apparently I still get an error...
Some good seconds after running 'edgesDemo' I get the following:

Invalid MEX-file
'/home/oded2/Documents/MATLAB/Pdollar-edges-master/private/edgesDetectMex.mexa64': dlopen:
cannot load any more object with static TLS.

Error in edgesDetect (line 57)
if(nargout<4), [E,inds] = edgesDetectMex(model,I,chnsReg,chnsSim);

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

How can we fix that?
Thank you

Edit: I have found the solution for that.
The problem is related to Matlab loading too much libraries relating to hardware.
Matlab had reported that this issue was fixed in the 2016 version, but we all know that's is not true... :-)
So, since it's a hardware and its related libraries problem, I figured that maybe the new Ubuntu version would be better. Apparently, upgrading from Ubuntu 14.04 to 16.04 indeed solve the problem!

Oded

@OdedHorowits
Copy link

OdedHorowits commented Jan 9, 2019 via email

@zchrissirhcz
Copy link

@OdedHorowits Congratulate that you've solved your problem.

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

4 participants