TensorFlow运行模型demo时常见问题

版权声明:版权所有 翻版必究 转载请注明来源 谢谢配合!!! https://blog.csdn.net/snail_youth/article/details/88180791

一、ImportError: cannot import name graph_util错误

当运行TensorFlow模型demo训练集时出现如下图的问题
在这里插入图片描述
解决方法
from tensorflow.python.framework import graph_util
修改成 from tensorflow.python.client import graph_util 即可

二、AttributeError: ‘module’ object has no attribute ‘global_variables_initializer’

当运行TensorFlow模型demo训练集时出现如下图的问题在这里插入图片描述
解决方法:
将错误提示对应行数的 tf.global_variables_initializer()
修改成tf.initialize_all_variables()即可

猜你喜欢

转载自blog.csdn.net/snail_youth/article/details/88180791