mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Databases with numpy

Open jmschrei opened this issue 11 years ago • 8 comments

I have several large numpy arrays I'd like to use for training, but they don't all fit in main memory. I know I can use NDArrayIter if I have the arrays in main memory, but I'd like to store and read them from disk. How can I store/read them using mxnet? These are not images.

jmschrei avatar Dec 02 '15 23:12 jmschrei

I'm working on that feature now. in the mean time, you can try ndarrayiter with this: http://docs.scipy.org/doc/numpy/reference/generated/numpy.memmap.html I've never tried this, but it should work. just remember to turn off shuffling.

Actually I think this solution is good enough. Please let me know if it works.

piiswrong avatar Dec 03 '15 01:12 piiswrong

Stay tuned. Will contribute a PR soon

winstywang avatar Dec 03 '15 03:12 winstywang

@winstywang does this issue be fixed?

mazeLinx avatar Dec 28 '15 05:12 mazeLinx

@piiswrong NDArrayIter doesn't work on numpy memory maps with more than 65535 number of arrays. I have a (75000, 4, 128, 128) nd-array and when I used NDArrayIter, it said TypeError: Invalid type '<class 'numpy.core.memmap.memmap'>' for data.

yl2612 avatar Feb 15 '17 14:02 yl2612

@yl2612 I come across the same error as you for the TypeError, Did you solve it or not?

yangshao avatar May 10 '17 21:05 yangshao

@yangshao i wrote my own iterator instead

yl2612 avatar May 10 '17 22:05 yl2612

hi,can you share it? thanks a lot!

On May 10, 2017 6:42 PM, "yl2612" [email protected] wrote:

@yangshao https://github.com/yangshao i wrote my own iterator instead

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dmlc/mxnet/issues/791#issuecomment-300633285, or mute the thread https://github.com/notifications/unsubscribe-auth/AIBBivuzx2lUI6t8FsjOoMkCaKGCBvppks5r4j1dgaJpZM4GtmLX .

yangshao avatar May 10 '17 22:05 yangshao

@yl2612 @yangshao did you solve this? if yes, could you please share code?

haehn avatar Aug 11 '17 16:08 haehn