Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while trying to Launch Tensorboard in the cell of Jupyter Notebook #5002

Closed
worldpeaceaspirer opened this issue May 21, 2021 · 9 comments

Comments

@worldpeaceaspirer
Copy link

worldpeaceaspirer commented May 21, 2021

Issue description

I'm trying to Launch Tensorboard from the Jupyter Notebook cell but it is resulting in error. My machine doesn't have a GPU and from the error message, I understand that Tensorboard is expecting GPU.

It is working fine in Google Colab.

Can't the Tensorboard be launched in the Local PC (Linux OS), which doesn't have a GPU, from a Jupyter Notebook cell?

Please find the reproducible code and the Error, below:

%load_ext tensorboard
!rm -rf logs

import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import numpy as np

model = Sequential([Dense(units = 3, input_shape = [1]),
                   Dense(units = 1)])
model.compile(optimizer = 'sgd', loss = 'mse')

x = np.array([-1.0, 0, 1, 2, 3, 4.0], dtype = 'float')
y = np.array([-3, -1.0, 1, 3.0, 5.0, 7.0], dtype = 'float')
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir="logs")

model.fit(x, y,epochs = 500, 
          batch_size = 2,
         verbose=1, callbacks = [tensorboard_callback])

%tensorboard --logdir logs

Error Message:

ERROR: Failed to launch TensorBoard (exited with 1).
Contents of stderr:
2021-05-21 18:31:51.972053: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-05-21 18:31:51.972099: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "/home/mothukuru/anaconda3/bin/tensorboard", line 8, in <module>
    sys.exit(run_main())
  File "/home/mothukuru/anaconda3/lib/python3.7/site-packages/tensorboard/main.py", line 75, in run_main
    app.run(tensorboard.main, flags_parser=tensorboard.configure)
  File "/home/mothukuru/anaconda3/lib/python3.7/site-packages/absl/app.py", line 300, in run
    _run_main(main, args)
  File "/home/mothukuru/anaconda3/lib/python3.7/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "/home/mothukuru/anaconda3/lib/python3.7/site-packages/tensorboard/program.py", line 289, in main
    return runner(self.flags) or 0
  File "/home/mothukuru/anaconda3/lib/python3.7/site-packages/tensorboard/program.py", line 305, in _run_serve_subcommand
    server = self._make_server()
  File "/home/mothukuru/anaconda3/lib/python3.7/site-packages/tensorboard/program.py", line 419, in _make_server
    ingester.deprecated_multiplexer,
  File "/home/mothukuru/anaconda3/lib/python3.7/site-packages/tensorboard/backend/application.py", line 149, in TensorBoardWSGIApp
    experimental_middlewares,
  File "/home/mothukuru/anaconda3/lib/python3.7/site-packages/tensorboard/backend/application.py", line 257, in __init__
    "Duplicate plugins for name %s" % plugin.plugin_name
ValueError: Duplicate plugins for name projector

Thank you in advance.

@bileschi
Copy link
Collaborator

It looks like the issue here is actually that the "projector" plugin is installed multiple times, possibly through some pip dependency entanglement.

ValueError: Duplicate plugins for name projector

Probably a similar error to #2759 or #3460

In that bug the recommendation was to use tensorflow 2.x , if possible. Would that work in your case?

@yatbear
Copy link
Member

yatbear commented May 21, 2021

Hi worldpeaceaspirer,

Confirmed that your code runs fine in Jupyter notebook, and Tensorboard loads with TF version 2.6.0:
image

@yatbear yatbear self-assigned this May 21, 2021
@worldpeaceaspirer
Copy link
Author

It looks like the issue here is actually that the "projector" plugin is installed multiple times, possibly through some pip dependency entanglement.

ValueError: Duplicate plugins for name projector

Probably a similar error to #2759 or #3460

In that bug the recommendation was to use tensorflow 2.x , if possible. Would that work in your case?

@bileschi,
Thank you for the timely response. I've tried it in TF-Version 2.5 and the error still persists.

@worldpeaceaspirer
Copy link
Author

@yatbear,
Thank you for your response. What Python Version are you using? Because, while trying to install tf-nightly in the Jupyter Notebook, it is giving the error shown below. Do you have any idea on how to fix it? Thank you once again.

ERROR: tf-nightly-2-0-preview 2.0.0.dev20190601 has requirement tb-nightly<1.15.0a0,>=1.14.0a0, but you'll have tb-nightly 2.4.0a20201022 which is incompatible.
ERROR: tensorflow 2.5.0 has requirement gast==0.4.0, but you'll have gast 0.3.3 which is incompatible.
ERROR: tensorflow 2.5.0 has requirement h5py~=3.1.0, but you'll have h5py 2.10.0 which is incompatible.
ERROR: tensorflow 2.5.0 has requirement numpy~=1.19.2, but you'll have numpy 1.18.5 which is incompatible.
ERROR: tensorflow-transform 0.24.1 has requirement tensorflow!=2.0.*,!=2.1.*,!=2.2.*,<2.4,>=1.15.2, but you'll have tensorflow 2.5.0 which is incompatible.
ERROR: tensorflow-text 2.3.0 has requirement tensorflow<2.4,>=2.3.0, but you'll have tensorflow 2.5.0 which is incompatible.
ERROR: tensorflow-gpu 2.0.0b1 has requirement tb-nightly<1.14.0a20190604,>=1.14.0a20190603, but you'll have tb-nightly 2.4.0a20201022 which is incompatible.
ERROR: tensorflow-gpu 2.0.0b1 has requirement tf-estimator-nightly<1.14.0.dev2019060502,>=1.14.0.dev2019060501, but you'll have tf-estimator-nightly 2.4.0.dev2020090201 which is incompatible.

I've filed an issue in Tensorflow Repository regarding the Installation Issue.

@yatbear
Copy link
Member

yatbear commented May 22, 2021

Hi @worldpeaceaspirer,

You are welcome!

I'm using python 3.9.2. I installed and ran the Jupyter Notebook in the same virtualenv that I ran the tensorboard (setup). Specific steps I've run:

$ virtualenv -p python3 tf
$ source tf/bin/activate
(tf)$ pip install --upgrade pip
(tf)$ pip install tf-nightly -r tensorboard/pip_package/requirements.txt -r tensorboard/pip_package/requirements_dev.txt

(tf)$ pip install jupyter-tensorboard
(tf)$ jupyter notebook

After the steps above, I was able to directly run the code you provided without any further installation in the Jupyter Notebook.

@bileschi
Copy link
Collaborator

bileschi commented Jun 1, 2021

@worldpeaceaspirer were you able to get the TensorBoard working in Jupyter using @yatbear's recipe?

@worldpeaceaspirer
Copy link
Author

worldpeaceaspirer commented Jun 11, 2021

@yatbear,
When I ran the command, virtualenv -p python3 tf, in the Terminal, it is resulting in the error shown below:

Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 6, in <module>
    from virtualenv.__main__ import run_with_catch
ModuleNotFoundError: No module named 'virtualenv'

@bileschi
Copy link
Collaborator

It seems that virtualenv is not installed on your development machine. Please see here for how to install and use the python virtual environment tool. Virtual environments are a pretty common way to isolate python module versions so that different programs don't interfere with eachother. You can read more about virtualenv here

https://virtualenv.pypa.io/en/latest/

Alternatively, python3 includes some of the same functionality natively now. You should be able to do the following as a substitute:

python3 -m venv tf

See more about the venv module here : https://docs.python.org/3/library/venv.html

@arghyaganguly
Copy link
Contributor

@worldpeaceaspirer ,closing this as there has been no response on this thread for sometime.Please feel free to reopen based on the comment trace.Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants