获取参数None具有无效的类型<type'NoneType'>

时间:2019-09-14 05:11:19

标签: python tensorflow deep-learning generative-adversarial-network

我正在尝试为GAN训练“生成器”。当我想要喂占位符时,出现以下错误:

_grads = mySess.run(params["gradient"],
         feed_dict={params["data"]["x"]: batch_Z})

params["gradient"]是:

params["gradient"] = optimizer.compute_gradients(loss, trainable_vars)

params [“ data”] [“ x”] = tf.placeholder(tf.float32,[None,z_shape])

损失和trainable_vars为:

loss = cost(tf.ones_like(disc_logits_fake), disc_logits_fake)
trainable_vars = [generator.W_conv1, generator.b_conv1, generator.W_conv2, generator.b_conv2, generator.W_conv3, generator.b_conv3, generator.W_conv4, generator.b_conv4]

我得到的错误是:

  

TypeError:获取参数None的类型无效

0 个答案:

没有答案