一篇很短的小短文,主要推荐下做科学计算是大量数据的储存问题 最近在做一个CNN的项目,文件夹里有20w张图片要读入并保存到一个data文件(不然每次都读20w文件太麻烦). 折腾了一个下午,发现了一个极好用的包 h5py:将数据储存在hdf5文件中. 这东西有多好用呢? 速度,内存占用,压缩程度都比cPickle+gzip来的优秀. 相比之下上面两个变逗比了…… 我把所有图片都放在一个ndarray并保存为一个文件: 8190张图片的.mat 16GB, 81900图片的.pkl.gz……根本就…