2020-10-16

keras直接读取mnist.npz文件中的数据

https://pan.baidu.com/s/1C3c2Vn-_616GqeEn7hQQ2Q 可以下载到mnist.npz,对大陆人。
之后,可以直接加入到内存中:

import tensorflow as tf
import numpy as np
with np.load('mnist.npz') as f:
    i0,l0 = f['x_train'], f['y_train']
    i1,l1 = f['x_test'], f['y_test']
print(i0.shape)

你可能感兴趣的:(basic,python,tensorflow)