我正在尝试通过提供图像批次来训练生成器,但不能这样做,
k=training(4,4)
2 SVG(model_to_dot(k,show_shapes=True).create(prog='dot',format='svg'))
<ipython-input-13-7ec7ab7d1121> in training(epochs, batch_size)
20
21 for batch in range(batch_num):
---> 22 batch_image = X_train[np.random.choice(range(X_train.shape[0]), batch_size, False)]
23 noise = np.random.normal(0, 1, (batch_size, latent_dim))
24
mtrand.pyx in mtrand.RandomState.choice()
TypeError: only integer scalar arrays can be converted to a scalar index