TensorFlow 模型建立与训练

MNISTLoaderget_batch方法第一行你多打了个 “.shape”……

下面的是正确写法

index = np.random.randint (0, np.shape (self.train_data)[0], batch_size)

或者

index = np.random.randint (0, self.num_train_data, batch_size)