Install visdom on your local system and remote server.
pip3 install visdom
On remote server, do:
ssh -N -f -L localhost:8097:localhost:8097 username@localsystemip
Set the same port in your python plotting script which you used in the port forwarding step above (8097
here).
Plotting script example [demo.py
]:
import visdom
import numpy as np
cfg = {"server": "localhost",
"port": 8097}
vis = visdom.Visdom('http://' + cfg["server"], port = cfg["port"])
vis.text('Hello Visdom!')
image = np.random.randint(0, 255, (3, 256, 256), dtype=np.uint8)
vis.image(image)
Run plotting script on remote server.
no_proxy=localhost python3 demo.py
Note for Ada: As of now, visdom only works if you have your proxy unset on Ada server. Either unset proxy with
export http_proxy=
or useno_proxy=localhost
before your python command.
Run visdom server on local machine.
visdom
View your plots locally at http://localhost:8097
.
This is very helpful, thanks very much!
In my case, I didn't have to run visdom on my local machine, only on my remote machine.