Variable encoder/E_conv0/w/Adam/ does not exist, or was not created with tf.get_variable(). Did you

运行tensorflow程序出错:

ValueError: Variable encoder/E_conv0/w/Adam/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?

其中详细错误如下图所示:


可以看到报错的位置为File "/home/liuyh/IDcar/Face-Aging/Face-Aging-CAAE-master/FaceAging.py", line 223, in train

    var_list=self.E_variables + self.G_variables

找到FaceAging.py的223行的位置,我的程序如下图所示:


找到了报错的位置,一开始我就在报错的位置附近找原因,最后发现并不是应该在这个地方改难过。随后我参考了其他大神的博文,发现应该在

if reuse_variables:

                tf.get_variable_scope().reuse_variables()

这句代码前加上一句:with tf.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值