tensorboard icon indicating copy to clipboard operation
tensorboard copied to clipboard

I can't run Tensorboard in Ubuntu: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)

Open Anatolist opened this issue 6 years ago • 10 comments

Tensorflow and Tensorboard ver. 2. ubuntu:16.04 Pre-trained model: ssd_mobilenet_v1_pets.config I have not written any custom code.

Hi everyone, a couple of days ago I ran Tensorboard in Ubuntu and I got results without any problem. I used a pre-trained model and I want to put the results into Tensorboard.

I have a remote session and I do the same yesterday, from models / object_detection folder, I run the command:

tensorboard --bind_all --port 6006 --logdir='training'

but I received the errors: TensorBoard 2.0.2 at http://ubuntu:6006/ (Press CTRL+C to quit) Traceback (most recent call last): File "/usr/local/bin/tensorboard", line 8, in <module> sys.exit(run_main()) File "/usr/local/lib/python2.7/dist-packages/tensorboard/main.py", line 66, in run_main app.run(tensorboard.main, flags_parser=tensorboard.configure) File "/usr/local/lib/python2.7/dist-packages/absl/app.py", line 299, in run _run_main(main, args) File "/usr/local/lib/python2.7/dist-packages/absl/app.py", line 250, in _run_main sys.exit(main(argv)) File "/usr/local/lib/python2.7/dist-packages/tensorboard/program.py", line 267, in main return runner(self.flags) or 0 File "/usr/local/lib/python2.7/dist-packages/tensorboard/program.py", line 283, in _run_serve_subcommand self._register_info(server) File "/usr/local/lib/python2.7/dist-packages/tensorboard/program.py", line 329, in _register_info manager.write_info_file(info) File "/usr/local/lib/python2.7/dist-packages/tensorboard/manager.py", line 267, in write_info_file payload = "%s\n" % _info_to_string(tensorboard_info) File "/usr/local/lib/python2.7/dist-packages/tensorboard/manager.py", line 126, in _info_to_string for k in _TENSORBOARD_INFO_FIELDS File "/usr/local/lib/python2.7/dist-packages/tensorboard/manager.py", line 126, in <dictcomp> for k in _TENSORBOARD_INFO_FIELDS UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)

I uninstall and install the Tesnorboard but the same errors. I would appreciate any help. Thank U

Anatolist avatar Apr 14 '20 12:04 Anatolist

@Anatolist his is caused by the default encoding difference between python 2.7 (ascii) and 3.x (utf-8). Try using python 3.x and let me know if the error still persists

gowthamkpr avatar Apr 14 '20 15:04 gowthamkpr

ss

Hi @Anatolist, You can also use a virtual environment.

rithiksachdev avatar Apr 14 '20 16:04 rithiksachdev

hi @gowthamkpr and @rithiksachdev, thank u for your answers

I have done exactly what you say and i got this: 2020-04-14 20:51:54.312045: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory 2020-04-14 20:51:54.312128: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory 2020-04-14 20:51:54.312146: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly. . TensorBoard 2.1.1 at http://ubuntu:6006/ (Press CTRL+C to quit)

I have a CPU installation.

But actually, except from error above TensorBoard 2.1.1 is running. So I connect with web service Tensorboard and it doesn't fetch any data yet. Should I wait for some time?

the message on the web said:

Probable causes: You haven’t written any scalar data to your event files. TensorBoard can’t find your event files.

I worry that the data of graphs are on the previous folder of Tensorflow I still have the object_detection and the training folder at the previous folder of Tensorflow so I ran it from:
(ENV) anatoli@ubuntu:~/tensorflow/TensorFlow/models/research/object_detection$ tensorboard --bind_all --port 6006 --logdir=’training’

but my new installation is : image

image

The new installation has access to the data of the training folder or should I copy them /and in which folder?

Thank U Anatoli

Anatolist avatar Apr 14 '20 18:04 Anatolist

Hi @Anatolist, I think you have missed something here as I cannot see any logs created by you and If that's the case then I will recommend that you should read this article. You'll have to add tensorboard_callback in your model to be precise. Hope this solves your problem :+1:

rithiksachdev avatar Apr 14 '20 19:04 rithiksachdev

Hi @rithiksachdev , You mean the logs of training, there are in the folder

image

Anatolist avatar Apr 14 '20 19:04 Anatolist

@Anatolist, What is the tensorflow version that you are using? I am using a different version of ubuntu, therefore, I tried to find if this problem had occurred with someone else. I would suggest you follow this comment and let me know if this makes sense. The comment solves two types of errors so make changes only that apply to your machine type. The issue is with your tensorflow so my suggestion would be to uninstall and reinstall tensorflow, check if that solves your issue then it's great.

rithiksachdev avatar Apr 14 '20 20:04 rithiksachdev

Hi @rithiksachdev, that comment was useful and I install the missing library. And I also reinstall and downgrade my version of TensorFlow and tensorboard from 2.1.1 to 2.0.0

Now I have:
TensorFlow 2.0.0 TensorFlow-estimator 2.0.1 tensorboard 2.0.2 I don t take any error while I am running from folder (ENV) anatoli@ubuntu:~/tensorflow/tensorflow/models/research/object_detection$ tensorboard --bind_all --port 6006 --logdir=’training’ response TensorBoard 2.0.2 at http://ubuntu:6006/ (Press CTRL+C to quit)

but the Tensorbord did not fetch any data. I am in a remote session but the web service open without data.

No scalar data was found. Probable causes:

_You haven’t written any scalar data to your event files. TensorBoard can’t find your event files. If you’re new to using TensorBoard, and want to find out how to add data and set up your event files, check out the README and perhaps the TensorBoard tutorial.

If you think TensorBoard is configured properly, please see the section of the README devoted to missing data problems and consider filing an issue on GitHub._

Anatolist avatar Apr 15 '20 10:04 Anatolist

Hi @Anatolist, I would suggest that if you could please run the diagnostics and post them here, We could understand the exact problem. You can also try removing the inverted comma from the --logdir='training' and use the correct path. ( You can use a pwd for this purpose. )

rithiksachdev avatar Apr 15 '20 11:04 rithiksachdev

So, I think that I found something and I resolve it.

I installed the Tensorflow 2.0 python 3.5 in a virtual environment, in the folder TensorFlow-venv3, image

image

But the object_detection API and the training folder are in a directory out of the virtual environment. the are in path
I ran the command from the virtual environment (ENV) anatoli@ubuntu:~/tensorflow/tensorflow/models/research/object_detection$ tensorboard --bind_all --port 6006 --logdir=home/anatoli/tensorflow/tensorflow/models/research/object_detection/training$ and nothing displayed.

I ran the same command out of the virtual environment, not from ENV:

anatoli@ubuntu:~/tensorflow/TensorFlow/models/research/object_detection$ tensorboard --bind_all --port 6006 --logdir=training and the graphs and results appear on Tensorboard

Anatolist avatar Apr 15 '20 13:04 Anatolist

Hi @Anatolist, I was asking you to run this diagnose_tensorboard.py file. We only need to specify the path from our working directory to the logs generated by tensorflow. If you face any error in your virtualenv then read the output and follow the directions. I hope this helps :smile:

rithiksachdev avatar Apr 15 '20 13:04 rithiksachdev