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?
%tensorboard --logdir logs
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>
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
(will give output as kernel path)
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.
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.
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
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
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
You can separately install the AI kit in your home directory and install the tensorboard package after sourcing the environment variables.
Hope this helps.
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
File "/glob/development-tools/versions/oneapi/2021.2/inteloneapi/intelpython/latest/envs/tensorflow/lib/python3.7/runpy.py", line 85, in _run_code
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>
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)