Tensorflow 错误ValueError

Tensorflow 错误ValueError: Variable already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:

错误截图

在这里插入图片描述

解决方案

在with tf.Session(config=tf_config) as sess: 语句之前增加 tf.reset_default_graph()

参考资料

1: https://github.com/kratzert/finetune_alexnet_with_tensorflow/issues/8
2: https://www.jianshu.com/p/fc11f32800f9
3: https://blog.csdn.net/Jerr__y/article/details/70809528

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章