首页 > 其他 > 详细

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

时间:2018-01-24 12:01:20      阅读:316      评论:0      收藏:0      [点我收藏+]
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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!