You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Saving large array fails with savez_compressed() but works with save() #5336
changed the title [-]Saving large array fails with savez_compressed() while works with save()[/-][+]Saving large array fails with savez_compressed() but works with save()[/+]on Dec 2, 2014
@pv Yeah, changing TMPDIR did the trick for me. It may also be worth noting that I'm on an NFS filesystem. I'm not sure what sort of effects, if any, that might have. I'm guessing that I'm into subtleties in the way that /tmp is configured.
Agreed. I ran onto this issue on HPC resources too and I agree that it would be good if the error / warning message recommended checking to make sure TMPDIR was set properly with adequate space.
Ran into the same problem (kudos to ngoldbaum@IRC for pointing me here). I understand that for temp storage TEMPDIR is usually the logical location. BUT when dealing with large datasets, there is a reason why we might want to savez to a different location and /tmp would never be big enough. So why not to follow any other downloader's behavior and use targetfilename + '_tempSMTHRANDOM' suffix instead. This has higher possibility to succeed since would use the target location/partition which should have adequate amount of storage. Also error message should include location of that temp file to give users sensible feedback
I have enough space on /tmp, but still ran into the IOError:
File "/data/anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/data/anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/data/anaconda/lib/python2.7/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
IOError: 938283800 requested and 364613622 written
So is this a common problem with numpy.savez? still no fix? which means I have to use "save" instead.
Activity
[-]Saving large array fails with savez_compressed() while works with save()[/-][+]Saving large array fails with savez_compressed() but works with save()[/+]omerlevy commentedon Mar 20, 2015
Got the same error... any solution in sight?
samuela commentedon Jul 10, 2015
I just got this error too but with
np.savezas opposed tonp.savez_compressed.samuela commentedon Jul 21, 2015
For future reference, using
np.saveinstead ofnp.savez[_compressed]seems to work as @omerlevy's example code indicates.So, is this an issue with
savez? Anyone who knows numpy well have any ideas what's happening here?pv commentedon Jul 21, 2015
savezneeds to store files temporarily on disk, and perhaps you run out of space on/tmp.Try setting
TMPDIR=$HOME/tmpor so.samuela commentedon Aug 14, 2015
@pv Yeah, changing
TMPDIRdid the trick for me. It may also be worth noting that I'm on an NFS filesystem. I'm not sure what sort of effects, if any, that might have. I'm guessing that I'm into subtleties in the way that /tmp is configured.samuela commentedon Aug 14, 2015
However, I think numpy should make this issue explicit in the documentation and provide some semblance of an intelligent, approachable error message.
pwolfram commentedon Dec 1, 2015
Agreed. I ran onto this issue on HPC resources too and I agree that it would be good if the error / warning message recommended checking to make sure
TMPDIRwas set properly with adequate space.yarikoptic commentedon Jan 27, 2016
Ran into the same problem (kudos to ngoldbaum@IRC for pointing me here). I understand that for temp storage TEMPDIR is usually the logical location. BUT when dealing with large datasets, there is a reason why we might want to savez to a different location and /tmp would never be big enough. So why not to follow any other downloader's behavior and use targetfilename + '_tempSMTHRANDOM' suffix instead. This has higher possibility to succeed since would use the target location/partition which should have adequate amount of storage. Also error message should include location of that temp file to give users sensible feedback
ENH: for savez create temporary file alongside with the target file
ENH: for savez create temporary file alongside with the target file
jinghuangzhu commentedon Jun 13, 2016
I have enough space on /tmp, but still ran into the IOError:
File "/data/anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/data/anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/data/anaconda/lib/python2.7/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
IOError: 938283800 requested and 364613622 written
So is this a common problem with numpy.savez? still no fix? which means I have to use "save" instead.
Improved IOError checking to be more helpful if a filesystem bug appe…