Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error opening tensorboard

I'm getting an error opening tensorboard. This is my code:

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()

This is the command:

tensorboard --logdir=path/to/log  

This is the ERROR:

File "c:\programdata\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals)
File "C:\ProgramData\Anaconda3\Scripts\tensorboard.exe__main__.py", line 5, in
File "c:\programdata\anaconda3\lib\site-packages\tensorboard\main.py", line 36, in
from tensorboard.plugins.audio import audio_plugin
File "c:\programdata\anaconda3\lib\site-packages\tensorboard\plugins\audio\audio_plugin.py", line 27, in
from tensorboard import plugin_util
File "c:\programdata\anaconda3\lib\site-packages\tensorboard\plugin_util.py", line 21, in
import bleach
File "c:\programdata\anaconda3\lib\site-packages\bleach__init__.py", line 14, in
from html5lib.sanitizer import HTMLSanitizer
File "c:\programdata\anaconda3\lib\site-packages\html5lib\sanitizer.py", line 7, in
from .tokenizer import HTMLTokenizer
File "c:\programdata\anaconda3\lib\site-packages\html5lib\tokenizer.py", line 17, in
from .inputstream import HTMLInputStream
File "c:\programdata\anaconda3\lib\site-packages\html5lib\inputstream.py", line 9, in
from .constants import encodings, ReparseException
ImportError: cannot import name 'encodings'

like image 587
Ash Avatar asked Dec 24 '22 12:12

Ash


1 Answers

I got the same error and fixed it. Apparently, there is a problem with html5lib, but mrry's suggestion does not solve it because a message will tell you that you already have the latest version installed.

Instead, run this:

pip install html5lib==1.0b8

More about this issue here: https://github.com/xhtml2pdf/xhtml2pdf/issues/318.

like image 108
Makondo Avatar answered Jan 09 '23 00:01

Makondo