Variable Generator/dense/kernel already exists, disallowed.

Jupyter notebook运行下面程序:https://github.com/MorvanZhou/Tensorflow-Tutorial/blob/master/tutorial-contents/406_GAN.py
上面程序是关于GAN的!
出现下面问题:

ValueError: Variable Generator/dense/kernel already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at: File "<ipython-input-15-11d84ae913e7>", line 34, in <module> G_l1 = tf.layers.dense(G_in, 128, tf.nn.relu) File "/home/zhumeiqiang/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2910, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "/home/zhumeiqiang/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2850, in run_ast_nodes if self.run_code(code, result):
 

解决方案:

  jupyter中有kernel选项,点击选择 “ Restart & RunAll ”,即可解决问题。

参考: https://blog.csdn.net/snailNL/article/details/80642695

 

posted @ 2018-07-11 10:37  BreakofDawn  阅读(636)  评论(0编辑  收藏  举报