启动Tensorboard时报错:
class BeholderHook(tf.estimator.SessionRunHook): AttributeError: module ‘tensorflow.python.estimator.estimator_lib’ has no attribute ‘SessionRunHook’
解决办法:是因为版本不对应
首先,检查下tensorboard的安装版本:
pip list --format=columns tensorboard (1.13.0) tensorflow (1.4.0) tensorflow-estimator (2.0.1) tensorflow-tensorboard (0.4.0)
我的tensorboard与tensorflow的版本不一致,
卸载tensorboard然后重新安装:
sudo pip uninstall tensorboard
由于找不到tensorflow1.4对应的版本,因此决定升级下tensorflow的版本到1.6:
升级tensorflow
sudo pip install --upgrade tensorflow==1.6.0
升级成功后,再安装tensorboard为1.6.0
sudo pip install tensorboard==1.6.0
在看安装版本
pip list --format=legacy tensorboard (1.6.0) tensorflow (1.6.0) tensorflow-estimator (2.0.1) tensorflow-tensorboard (0.4.0)
之后再启动tensorboard:
tensorboard --logdir=log TensorBoard 1.6.0 at http://uubbtt-virtual-machine:6006 (Press CTRL+C to quit)
解决!