tensorflow中使用tf.variable_scope和tf.get_variable的ValueError
2018-01-24 11:09
645 查看
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】scope的使用以及tf.Variable()和tf.get_variable()的区别
- Tensorflow中tf.get_variable和tf.variable_scope的使用
- [Tensorflow]Sharing Variables 共享权值【tf.get_variable 和 tf.variable_scope】
- TensorFlow学习--tf.get_variable使用
- 简单Tensorflow线性拟合类及tf.get_variable()使用示例
- tensorflow的共享变量,tf.Variable(),tf.get_variable(),tf.Variable_scope(),tf.name_scope()联系与区别
- tensorflow的共享变量,tf.Variable(),tf.get_variable(),tf.Variable_scope(),tf.name_scope()联系与区别:
- tensorflow 变量生成 变量管理 tf.Variable & tf.get_variable & tf.variable_scope
- tensorflow的共享变量,tf.Variable(),tf.get_variable(),tf.Variable_scope(),tf.name_scope()联系与区别
- TensorFlow 学习(一)—— tf.get_variable() vs tf.Variable(),tf.name_scope() vs tf.variable_scope()
- TensorFlow 学习(一)—— tf.get_variable() vs tf.Variable(),tf.name_scope() vs tf.variable_scope()
- TensorFlow基础笔记(13) tf.name_scope tf.variable_scope学习
- tensorflow variable_scope,tf.name_scope, tf.variable, tf.get_varible
- tf.variable_scope()和tf.name_scope(),tf.Variable()和tf.get_variable()
- tf.get_variable 和tf.variable_scope
- Tensorflow函数——tf.variable_scope()
- ValueError: Variable E_conv0/w/Adam/ does not exist, or was not created with tf.get_variable().
- tensorflow之变量作用域与变量共享(name_scope,variable_scope,get_variable,Variable)
- TensorFlow学习--tf.add_to_collection与tf.get_collection使用
- tf.get_variable 和tf.variable_scope