Intel® DevCloud
Help for those needing help starting or connecting to the Intel® DevCloud
1642 Discussions

%tensorboard magic

GAnthony_R_Intel
Employee
3,070 Views

I don't seem to be able to use the %tensorboard magic for oneAPI DevCloud's Jupyter Notebooks.

Is there a way to set this up in an environment?

 

https://www.tensorflow.org/tensorboard/tensorboard_in_notebooks

 

%tensorboard --logdir logs
0 Kudos
9 Replies
RaeesaM_Intel
Moderator
3,055 Views

Hi


Please follow these steps to use tensorboard magic command on devcloud :


#Create  a conda environment and install all the necessary packages

conda create -n <env_name>

source activate <env_name>

pip install –user <package>


#installing ipykernel

conda install ipykernel


#to get that kernel in jupyter notebook

python -m ipykernel install --user --name <env_name> 


Open the jupyter lab and set the kernel to this environment

Kernelàchange kernelà select one you want


#check whether the kernel is set properly run the command in a cell

import sys

sys.executable

(will give output as kernel path)


#tunneling

Enter command `jupyter notebook --no-browser --port=8880` on a remote shell

Open another prompt for port forwarding  and run the below commands

ssh -L 8880:localhost:8880 devcloud

ssh -L 8880:localhost:8880 s001-n0xx

Copy-paste the URL address from the host into your local browser to open the jupyter console.


#Now run the tensorboard commands.


Hope this will work fine. Get back to us if you have any further issues.

Thanks,

Raeesa


0 Kudos
RaeesaM_Intel
Moderator
3,041 Views

Hi,


Has the solution provided helped? Please let us know the updates.


Thank you


0 Kudos
GAnthony_R_Intel
Employee
3,025 Views

Is there a way the pre-defined kernel can include this by default on oneAPI DevCloud? I'm thinking that new users don't want to do this manually? TensorBoard is a pretty nice addition and the magic command is useful for Jupyter Notebooks.

0 Kudos
RaeesaM_Intel
Moderator
3,013 Views

Hi,


You can install the tensorboard package in your existing conda environment so that its available in its jupyter notebook kernel.

conda install -c conda-forge tensorboard


Thank you.


0 Kudos
GAnthony_R_Intel
Employee
3,008 Views

Thanks. When I try that I get:

EnvironmentNotWriteableError: the current user does not have write permissions to the target environment.
environment location: /glob/development-tools/versions/oneapi/beta09/inteloneapi/intelpython/latest

 

0 Kudos
RaeesaM_Intel
Moderator
2,985 Views

Hi,


We are restricted from installing extra packages in the base environment where python path is of /glob/development-tools/versions/oneapi/beta09/inteloneapi/intelpython/latest/bin/python


In order to install extra packages, you need to clone the existing AI environment.

conda create --name <env-name> --clone base

conda activate <env-name>

see ‘which python' and make sure that the python path is of the cloned environment path --> /home/uxxxxx/.conda/envs/<env-name>/bin/python

Install tensorboard :

conda install -c conda-forge tensorboard

OR

You can separately install the AI kit in your home directory and install the tensorboard package after sourcing the environment variables.


Hope this helps.

Raeesa


0 Kudos
RaeesaM_Intel
Moderator
2,961 Views

Hi,

 

Has the solution provided helped you ? Please let us know the updates.

 

Thank you

 

RaeesaM_Intel
Moderator
2,900 Views

Hi,


We haven't heard back from you . We are discontinuing monitoring this thread. Please raise a new query in case if you have any further issues.


Thank you,

Raeesa


0 Kudos
sara_petiton
Employee
2,623 Views

Hello,

 

I've encountered a similar problem. On jupyter notebook using DevCloud the command "%tensorboard --logdir logs" doesn't work. It gives out the following error:

ERROR: Could not find `tensorboard`. Please ensure that your PATH
contains an executable `tensorboard` program, or explicitly specify
the path to a TensorBoard binary by setting the `TENSORBOARD_BINARY`
environment variable. 

I then ran a python file with the same code as the jupyter notebook and got an error as well. However, I can see the collection directory: the logs are being saved. Which means that the visual interface won't function but the rest of tensorboard works.

After running the .py file on the conda environment "tensorflow" on DevCloud, I get this return to "python3 -m tensorboard.main --logdir=logs":

 

(tensorflow) u74740@s001-n059:~$ python3 -m tensorboard.main --logdir=logs

Traceback (most recent call last):

  File "/glob/development-tools/versions/oneapi/2021.2/inteloneapi/intelpython/latest/envs/tensorflow/lib/python3.7/runpy.py", line 193, in _run_module_as_main

    "__main__", mod_spec)

  File "/glob/development-tools/versions/oneapi/2021.2/inteloneapi/intelpython/latest/envs/tensorflow/lib/python3.7/runpy.py", line 85, in _run_code

    exec(code, run_globals)

  File "/glob/development-tools/versions/oneapi/2021.2/inteloneapi/intelpython/latest/envs/tensorflow/lib/python3.7/site-packages/tensorboard/main.py", line 43, in <module>

    from tensorboard import default

  File "/glob/development-tools/versions/oneapi/2021.2/inteloneapi/intelpython/latest/envs/tensorflow/lib/python3.7/site-packages/tensorboard/default.py", line 39, in <module>

    from tensorboard.plugins.audio import audio_plugin

  File "/glob/development-tools/versions/oneapi/2021.2/inteloneapi/intelpython/latest/envs/tensorflow/lib/python3.7/site-packages/tensorboard/plugins/audio/audio_plugin.py", line 28, in <module>

    from tensorboard.data import provider

  File "/glob/development-tools/versions/oneapi/2021.2/inteloneapi/intelpython/latest/envs/tensorflow/lib/python3.7/site-packages/tensorboard/data/__init__.py", line 20, in <module>

    from tensorboard.data import experimental

  File "/glob/development-tools/versions/oneapi/2021.2/inteloneapi/intelpython/latest/envs/tensorflow/lib/python3.7/site-packages/tensorboard/data/experimental/__init__.py", line 20, in <module>

    from tensorboard.data.experimental.experiment_from_dev import ExperimentFromDev

  File "/glob/development-tools/versions/oneapi/2021.2/inteloneapi/intelpython/latest/envs/tensorflow/lib/python3.7/site-packages/tensorboard/data/experimental/experiment_from_dev.py", line 25, in <module>

    import grpc

  File "/glob/development-tools/versions/oneapi/2021.2/inteloneapi/intelpython/latest/envs/tensorflow/lib/python3.7/site-packages/grpc/__init__.py", line 23, in <module>

    from grpc._cython import cygrpc as _cygrpc

ImportError: cannot import name 'cygrpc' from 'grpc._cython' (/glob/development-tools/versions/oneapi/2021.2/inteloneapi/intelpython/latest/envs/tensorflow/lib/python3.7/site-packages/grpc/_cython/__init__.py)

0 Kudos
Reply