启动tonsorboard出现问题
电脑上已经安装了tensorboard,能够在Scripts里面找到tensorboard.exe,但是启动的时候报错:
Traceback (most recent call last):
File "c:programdataanaconda3librunpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:programdataanaconda3librunpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:ProgramDataAnaconda3Scriptstensorboard.exe__main__.py", line 5, in <module>
File "c:programdataanaconda3libsite-packagestensorboardmain.py", line 36, in <module>
from tensorboard.plugins.audio import audio_plugin
File "c:programdataanaconda3libsite-packagestensorboardpluginsaudioaudio_plugin.py", line 27, in <module>
from tensorboard import plugin_util
File "c:programdataanaconda3libsite-packagestensorboardplugin_util.py", line 21, in <module>
import bleach
File "c:programdataanaconda3libsite-packagesbleach__init__.py", line 14, in <module>
from html5lib.sanitizer import HTMLSanitizer
File "c:programdataanaconda3libsite-packageshtml5libsanitizer.py", line 7, in <module>
from .tokenizer import HTMLTokenizer
File "c:programdataanaconda3libsite-packageshtml5libtokenizer.py", line 17, in <module>
from .inputstream import HTMLInputStream
File "c:programdataanaconda3libsite-packageshtml5libinputstream.py", line 9, in <module>
from .constants import encodings, ReparseException
ImportError: cannot import name 'encodings'
下面是代码,是照着数上敲的:
import tensorflow as tf
a = tf.constant(5,name = 'input_a')
b = tf.constant(3,name = 'input_b')
c = tf.multiply(a,b,name='mul_c')
d = tf.add(a,b,name='add_d')
e = tf.add(c,d,name = 'add_e')
with tf.Session() as sess:
output = sess.run(e)
print(output)
writer = tf.summary.FileWriter('path/to/log',tf.get_default_graph())
writer.close()
cmd里的:
tensorboard -logdir=path/to/log
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我之前遇到过一个类似的问题,我是这么解决的,不知道对你时候有帮助。
tensorflow版本太低了……我更新了一下tensorflow就可以了
path/to/log 是绝对路径吗