如何从生成器中的数据集中加载一批图像?

时间:2019-06-29 18:46:50

标签: python-3.x keras conv-neural-network generative-adversarial-network

我正在尝试通过提供图像批次来训练生成器,但不能这样做,

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

0 个答案:

没有答案