luispedro / mahotas

Computer Vision in Python
https://mahotas.rtfd.io
Other
844 stars 148 forks source link

MemoryError in Haralick feature #69

Closed hackermd closed 8 years ago

hackermd commented 8 years ago

Working with a uint16 image, I got the following error in mahotas.features.texture line 112:

---------------------------------------------------------------------------
MemoryError                               Traceback (most recent call last)
<ipython-input-6-efdb5c1eef9d> in <module>()
----> 1 np.empty((fm1, fm1), np.int32)

MemoryError: 

In this case the value of fm1 was 37531.

hackermd commented 8 years ago

Sorry, it seems this is not related to your code. I can not reproduce this problem on another machine..

luispedro commented 8 years ago

This is actually an FAQ:

http://mahotas.readthedocs.org/en/latest/faq.html#i-ran-out-of-memory-computing-haralick-features-on-16-bit-images-is-it-not-supported

I suppose we could do a little better in the error message department, but mahotas is trying to do what it's asked of it, but it doesn't have enough memory to do so.

hackermd commented 8 years ago

Thanks for your feedback! I think this issue is already sufficiently addressed in the FAQs, I should have simply read them before creating this issue.