TensorFlow运行模型demo时常见问题

一、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()即可

posted @ 2019-03-05 20:11  帅气的搬砖工  阅读(371)  评论(0编辑  收藏  举报