[Numpy-discussion] create a numpy array of images
Sturla Molden
sturla at molden.no
Tue Feb 1 08:49:39 EST 2011
Den 1. feb. 2011 kl. 11.20 skrev "totonixsame at gmail.com" <totonixsame at gmail.com
>:
> I have one more question: how to avoid the limitation of memoryerror
> in
>>
>> numpy. as I have like 200 images to stack in the numpy array of say
>> 1024x1344 resolution.. have any idea apart from downsampling?
>
> Take a look at numpy.memmap or h5py [1].
>
memmap will not help unless he uses 64 bit Python, in which case he
can just buy more RAM if he has too little. I suspect he is running
out of virtual memory, not physical, for which 64 bit is the easiest
solution. It is not possible to compensate for lack of virtual memory
(typically 2GB limit with 32 bit) by memory mapping file into the
already exhausted memory space.
Using a database like h5py will help too, unless he tries to extract
them all at once.
Sturla
More information about the NumPy-Discussion
mailing list