ValueError: Variable conv1/weights already exists.

跑TensorFlow程序的过程中出现了错误,解决之后再次跑时,报如下错误:

ValueError: Variable conv1/weights already exists, 

原因

这是因为我在Spyder的Python控制台里跑的原因,Python的控制台会保存上次运行结束的变量。

解决办法
在程序的开头加上下边的代码。

tf.reset_default_graph()
posted @ 2019-07-01 22:04  珠峰上吹泡泡  阅读(572)  评论(0编辑  收藏  举报