TensorFlow ValueError: Variable does not exist, or was not created with tf.get_variable()

后端 未结 2 507
生来不讨喜
生来不讨喜 2021-02-10 11:33

I am a newbie to Tensorflow and trying to implement a Generative Adversarial Network. I am following this tutorial for the same in which we are trying to generate MNIST dataset

相关标签:
2条回答
  • 2021-02-10 11:47

    Please modify your code as following,

    with tf.variable_scope(tf.get_variable_scope(),reuse=False): trainerD = tf.train.AdamOptimizer().minimize(d_loss, var_list=d_vars) trainerG = tf.train.AdamOptimizer().minimize(g_loss, var_list=g_vars)

    0 讨论(0)
  • 2021-02-10 11:51

    Things of this sort can be caused by having two GPUs and the layer definitions being split between them, causing them not to be present on one device. One solution is to use only one device by specifying export CUDA_VISIBLE_DEVICES=0

    0 讨论(0)
提交回复
热议问题