【发布时间】:2020-11-05 07:43:42
【问题描述】:
我现在使用 MNIST 和彩色数字版本来训练我的 SemGAN 模型。我已经加载并预处理了数据集。
x_train = x_train[0:10000]
y_train = y_train[0:10000]
x_test = x_test[0:10]
y_test = y_test[0:10]
x_train = x_train.reshape(-1, 28, 28, 1).astype(np.float32)
x_test = x_test.reshape(-1, 28, 28, 1).astype(np.float32)
现在我必须将每个重塑后的数据 (28, 28, 1) 按顺序提供给模型(批量或随机批量),我该怎么做?谁能帮帮我?
【问题讨论】:
-
你用的是什么框架:tensorflow、pytorch?通常有很多教程可供您参考,尤其是对于像输入数据集这样相对简单的东西。
-
感谢您的回复,安德鲁。我正在使用 TensorFlow 1.15。我想得到的是 input_i 代表来自 MNIST 的张量,然后我做
inputs_i=tf.train.batch(input_i, Batch_size)。问题是我怎样才能得到这个 input_i。
标签: python tensorflow mnist