Skip to content

Visdom

Visdom is a PyTorch data visualization tool developed by Facebook.

Install

tip

Instances do not provide public IP addresses, and services are linked through port mapping to public access points. To use Visdom, you need to stop the TensorBoard service, and configure the Visdom port to the same port 6006 as TensorBoard, and the listening address needs to be 0.0.0.0.

pip install visdom

## Replace the address for downloading static files to prevent download
sed -i "s/https:\/\/\(cdnjs.cloudflare.com.*\)/http:\/\/\1/" "$(pip show visdom | grep Location | awk '{print $2} ')/visdom/server.py"

# Stop TensorBoard service
supervisorctl stop tensorboard

# If you need to prohibit TensorBoard from starting with the instance, use the following command to configure
grep -E "autostart" /etc/supervisor/conf.d/tensorboard.conf || echo "autostart = false" >>/etc/supervisor/conf.d/tensorboard.conf
supervisorctl update

# Start the Visdom service
visdom --hostname 0.0.0.0 -port 6006

Click TensorBoard in the instance list to open the Visdom page.

use

The Visdom service is started locally on port 6006, and the parameter port=6006 needs to be added when the Python client is initialized.

import visdom
import numpy as np

vis = visdom.Visdom(port=6006)
vis.text('Hello, world!')