Skip to content
Snippets Groups Projects

Tensorboard cooking...

parent 769d6b58
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
Running Tensorboard from Jupyter lab
====================================
---
Introduction au Deep Learning (IDLE) - S. Arias, E. Maldonado, JL. Parouty - CNRS/SARI/DEVLOG - 2020
Vesion : 1.0
%% Cell type:markdown id: tags:
## Méthode 1 : Shell execute
**Start**
%% Cell type:code id: tags:
``` python
%%bash
tensorboard_start --logdir ./run/logs
```
%% Output
Tensorbord started with pid 84593
%% Cell type:code id: tags:
``` python
%%bash
tensorboard_stop
```
%% Output
Tensorboard process not found...
%% Cell type:code id: tags:
``` python
%%bash
# ---- Port number,
PORT_JPY="$(id -u)"
PORT_TSB="$(( $PORT_J + 10000 ))"
HOST_G="$(hostname)"
SSH_CMD="/usr/bin/ssh -NL 8888:$HOST_G:$PORT_J -L 6006:$HOST_G:$PORT_T dahu.ciment"
tensorboard --port 21277 --host 0.0.0.0 --logdir ./run/logs &>/dev/null &
```
%% Cell type:markdown id: tags:
**Check**
%% Cell type:code id: tags:
``` python
!echo $(ps ax | grep 'tensorboard --port 21277' | grep -v grep | awk '{print $1}')
```
%% Output
84593
%% Cell type:code id: tags:
``` python
!ps ax | grep tensorboard
!pwd
```
%% Output
83294 pts/0 Ss+ 0:00 /bin/sh -c ps ax | grep tensorboard
83296 pts/0 S+ 0:00 grep tensorboard
/home/paroutyj/fidle/GTSRB
%% Cell type:markdown id: tags:
**Stop**
%% Cell type:code id: tags:
``` python
%%bash
p="$(ps ax | grep 'tensorboard --port 21277' | grep -v grep | awk '{print $1}')"
if [ -z ${p} ]; then echo "No process"; else kill $p; echo "Ended ($p)" ; fi
```
%% Output
Ended (82555)
%% Cell type:markdown id: tags:
## Méthode 2 : Magic command
**Start**
%% Cell type:code id: tags:
``` python
%load_ext tensorboard
```
%% Cell type:code id: tags:
``` python
%tensorboard --port 21277 --host 0.0.0.0 --logdir ./run/logs
```
%% Cell type:markdown id: tags:
**Stop**
No way... use bash method
## Methode 3 : Tensorboard module
**Start**
%% Cell type:code id: tags:
``` python
import tensorboard.notebook as tsb
```
%% Cell type:code id: tags:
``` python
notebook.start('--port 21277 --host 0.0.0.0 --logdir ./run/logs')
tsb.start('--port 21277 --host 0.0.0.0 --logdir ./run/logs')
```
%% Output
%% Cell type:markdown id: tags:
**Check**
%% Cell type:code id: tags:
``` python
a=tsb.list()
```
%% Cell type:markdown id: tags:
**Stop**
No way... use bash method
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment