question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbc in position 0: invalid start byte

See original GitHub issue
  • os: windows
  • tensorflow r1.3

when I try to open tensorboard in cmd, I got following error:

Exception in thread Reloader:
Traceback (most recent call last):
  File "c:\users\15384\anaconda3\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "c:\users\15384\anaconda3\lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\15384\anaconda3\lib\site-packages\tensorboard\backend\application.py", line 327, in _reload_forever
    reload_multiplexer(multiplexer, path_to_run)
  File "c:\users\15384\anaconda3\lib\site-packages\tensorboard\backend\application.py", line 299, in reload_multiplexer
    multiplexer.AddRunsFromDirectory(path, name)
  File "c:\users\15384\anaconda3\lib\site-packages\tensorboard\backend\event_processing\plugin_event_multiplexer.py", line 175, in AddRunsFromDirectory
    for subdir in GetLogdirSubdirectories(path):
  File "c:\users\15384\anaconda3\lib\site-packages\tensorboard\backend\event_processing\plugin_event_multiplexer.py", line 445, in <genexpr>
    subdir
  File "c:\users\15384\anaconda3\lib\site-packages\tensorboard\backend\event_processing\io_wrapper.py", line 50, in ListRecursively
    for dir_path, _, filenames in tf.gfile.Walk(top):
  File "c:\users\15384\anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 514, in walk
    for subitem in walk(os.path.join(top, subdir), in_order):
  File "c:\users\15384\anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 514, in walk
    for subitem in walk(os.path.join(top, subdir), in_order):
  File "c:\users\15384\anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 495, in walk
    listing = list_directory(top)
  File "c:\users\15384\anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 474, in list_directory
    compat.as_bytes(dirname), status)
  File "c:\users\15384\anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 473, in <listcomp>
    for filename in pywrap_tensorflow.GetChildren(
  File "c:\users\15384\anaconda3\lib\site-packages\tensorflow\python\util\compat.py", line 106, in as_str_any
    return as_str(value)
  File "c:\users\15384\anaconda3\lib\site-packages\tensorflow\python\util\compat.py", line 84, in as_text
    return bytes_or_text.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbc in position 31: invalid start byte

Traceback (most recent call last):
  File "c:\users\15384\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\15384\anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\15384\Anaconda3\Scripts\tensorboard.exe\__main__.py", line 9, in <module>
  File "c:\users\15384\anaconda3\lib\site-packages\tensorboard\main.py", line 240, in main
    run_simple_server(tb)
  File "c:\users\15384\anaconda3\lib\site-packages\tensorboard\main.py", line 208, in run_simple_server
    server, url = make_simple_server(tb_app)
  File "c:\users\15384\anaconda3\lib\site-packages\tensorboard\main.py", line 183, in make_simple_server
    server = serving.make_server(host, port, tb_app, threaded=True)
  File "c:\users\15384\anaconda3\lib\site-packages\werkzeug\serving.py", line 587, in make_server
    passthrough_errors, ssl_context, fd=fd)
  File "c:\users\15384\anaconda3\lib\site-packages\werkzeug\serving.py", line 504, in __init__
    HTTPServer.__init__(self, (host, int(port)), handler)
  File "c:\users\15384\anaconda3\lib\socketserver.py", line 453, in __init__
    self.server_bind()
  File "c:\users\15384\anaconda3\lib\http\server.py", line 138, in server_bind
    self.server_name = socket.getfqdn(host)
  File "c:\users\15384\anaconda3\lib\socket.py", line 673, in getfqdn
    hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbc in position 0: invalid start byte

I try to solve it by reinstall tensorboard. Failed.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
zhaoyiCCcommented, Mar 8, 2019

@nfelt I got the error, can you tell me how to solve? Thx a lot.

/opt/conda/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 return f(*args, **kwds) /opt/conda/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 return f(*args, **kwds) TensorBoard 1.10.0 at http://server3:8006 (Press CTRL+C to quit) W0308 03:36:10.078827 Thread-1 application.py:276] path /[[_dataImageSrc]] not found, sending 404 W0308 03:36:10.078827 140575728711424 application.py:276] path /[[_dataImageSrc]] not found, sending 404 W0308 03:36:10.139928 Thread-1 application.py:276] path /[[_imageURL]] not found, sending 404 W0308 03:36:10.139928 140575728711424 application.py:276] path /[[_imageURL]] not found, sending 404 E0308 03:36:16.068375 Thread-1 _internal.py:88] Error on request: Traceback (most recent call last): File "/opt/conda/lib/python3.6/site-packages/werkzeug/serving.py", line 270, in run_wsgi execute(self.server.app) File "/opt/conda/lib/python3.6/site-packages/werkzeug/serving.py", line 258, in execute application_iter = app(environ, start_response) File "/opt/conda/lib/python3.6/site-packages/tensorboard/backend/application.py", line 274, in __call__ return self.data_applications[clean_path](environ, start_response) File "/opt/conda/lib/python3.6/site-packages/werkzeug/wrappers.py", line 308, in application resp = f(*args[:-2] + (request,)) File "/opt/conda/lib/python3.6/site-packages/tensorboard/plugins/projector/projector_plugin.py", line 514, in _serve_metadata for line in f: File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 220, in __next__ return self.next() File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 214, in next retval = self.readline() File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 184, in readline return self._prepare_value(self._read_buf.ReadLineAsString()) File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 100, in _prepare_value return compat.as_str_any(val) File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/util/compat.py", line 107, in as_str_any return as_str(value) File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/util/compat.py", line 80, in as_text return bytes_or_text.decode(encoding) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 0: invalid continuation byte E0308 03:36:16.068375 140575728711424 _internal.py:88] Error on request: Traceback (most recent call last): File "/opt/conda/lib/python3.6/site-packages/werkzeug/serving.py", line 270, in run_wsgi execute(self.server.app) File "/opt/conda/lib/python3.6/site-packages/werkzeug/serving.py", line 258, in execute application_iter = app(environ, start_response) File "/opt/conda/lib/python3.6/site-packages/tensorboard/backend/application.py", line 274, in __call__ return self.data_applications[clean_path](environ, start_response) File "/opt/conda/lib/python3.6/site-packages/werkzeug/wrappers.py", line 308, in application resp = f(*args[:-2] + (request,)) File "/opt/conda/lib/python3.6/site-packages/tensorboard/plugins/projector/projector_plugin.py", line 514, in _serve_metadata for line in f: File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 220, in __next__ return self.next() File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 214, in next retval = self.readline() File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 184, in readline return self._prepare_value(self._read_buf.ReadLineAsString()) File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 100, in _prepare_value return compat.as_str_any(val) File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/util/compat.py", line 107, in as_str_any return as_str(value) File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/util/compat.py", line 80, in as_text return bytes_or_text.decode(encoding) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 0: invalid continuation byte

1reaction
nfeltcommented, Oct 31, 2017

Okay, hmm. I’m surprised that you’re on python 3.6 and still seeing the hostname issue. What exact subversion of 3.6 are you on, i.e. the output of python --version? Can you try running the following:

python -c "import socket; print(socket.getfqdn()); print(socket.gethostbyaddr(socket.gethostname()))"

Depending on the results of that, it might also be helpful if you can reproduce the issue with vanilla python (i.e. downloaded directly from https://www.python.org/downloads/release/python-363/)

For the other issue, here’s a revised code snippet, could you try this one?

python -c "import os; import tensorflow as tf; status = tf.pywrap_tensorflow.TF_NewStatus(); print(tf.pywrap_tensorflow.GetChildren(tf.compat.as_bytes(os.getcwd()), status))"

Also, could you include what characters you’re setting the hostname to when you include the output of the commands? It looks like in your previous comment the hostname was set to 吉豪宝宝的电脑 in at least the first command, but confirmation would be helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'utf8' codec can't decode byte 0xa5 in position 0: invalid start ...
I switched this simply by defining a different codec package in the read_csv() command: encoding = 'unicode_escape'.
Read more >
Python UnicodeDecodeError utf-8 codec can t decode byte ...
Python UnicodeDecodeError utf-8 codec can t decode byte 0xa0 in position 10 invalid start byte.
Read more >
'utf-8' codec can't decode byte 0xff in position 0 | bobbyhadz
The Python "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte" occurs when we specify an incorrect encoding when ......
Read more >
'utf8' codec can't decode byte 0xa5 in position 0: invalid start ...
Introduction. Problem Statement: How to fix “UnicodeDecodeError: 'utf8' codec can't decode byte 0xa5 in position 0: invalid start byte” in Python?
Read more >
'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
UnicodeDecodeError : ' utf-8 ' codec can't decode byte 0xff in position 0 : invalid start byte solved in Django .The error is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found