AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'SessionRunHook'

启动Tensorboard时报错:
class BeholderHook(tf.estimator.SessionRunHook):
AttributeError: module ‘tensorflow.python.estimator.estimator_lib’ has no attribute ‘SessionRunHook’
谷歌一番,找到了解决办法:是因为版本不对应,版本这个坑,,,,哎

首先,检查下tensorboard的安装版本:

pip list

AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'SessionRunHook'
很明显我的tensorboard与tensorflow的版本不一致,

卸载tensorboard然后重新安装:

 sudo pip uninstall tensorboard

由于找不到tensorflow1.5对应的版本,因此决定升级下tensorflow的版本到1.6:

升级tensorflow

sudo pip install --upgrade tensorflow==1.6.0

升级成功后,再

pip list

AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'SessionRunHook'
为了都保持一致,因此顺便升级了GPU版的tensorflow:

sudo pip install --upgrade tensorflow-gpu==1.6

AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'SessionRunHook'
之后再启动tensorboard:

tensorboard --logdir='logs' --port=10042    #10042是服务器可用的端口号,可根据情况修改

启动成功:

AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'SessionRunHook'
在客户端打开浏览器,输入GPU服务器地址以及端口号:
AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'SessionRunHook'
由于没有运行代码,所以我这个截图没有显示的内容~