码迷,mamicode.com
首页 > 其他好文 > 详细

tensorflow中使用tf.variable_scope和tf.get_variable的ValueError

时间:2018-01-24 12:43:44      阅读:614      评论:0      收藏:0      [点我收藏+]

标签:console   flow   variable   错误   python   isa   value   ons   内存   

ValueError: Variable conv1/weights1 already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:

在使用tensorflow 中的tf.variable_scope和tf.get_variable搭建网络时,重复运行程序会报以上的ValueError错误,这是因为第二次运行时,内存中已经存在名字相同的层或者参数,发生了冲突,所以会提示是否要reuse。

解决方案:

(1)如果你用的是spyder编译的程序,重新启动一下python console就好了

(2)终端运行程序则不会出现上述问题

tensorflow中使用tf.variable_scope和tf.get_variable的ValueError

标签:console   flow   variable   错误   python   isa   value   ons   内存   

原文地址:https://www.cnblogs.com/wktwj/p/8340711.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!