CorentinJ/Real-Time-Voice-Cloning · warning · Exception

No visdom server detected. Run the command \"visdom\" in you

Error message

No visdom server detected. Run the command \"visdom\" in your CLI to start it.

What it means

Raised by UiVisualizer.__init__ (encoder/visualizations.py) when constructing visdom.Visdom(server, env=..., raise_exceptions=True) raises ConnectionError. Visdom plots training metrics (loss, EER, embeddings projection) in a browser dashboard served by a separate local server; the client here connects eagerly at construction time, so an absent server aborts visualization setup.

Source

Thrown at encoder/visualizations.py:54

        print("Updating the visualizations every %d steps." % update_every)

        # If visdom is disabled TODO: use a better paradigm for that
        self.disabled = disabled
        if self.disabled:
            return

        # Set the environment name
        now = str(datetime.now().strftime("%d-%m %Hh%M"))
        if env_name is None:
            self.env_name = now
        else:
            self.env_name = "%s (%s)" % (env_name, now)

        # Connect to visdom and open the corresponding window in the browser
        try:
            self.vis = visdom.Visdom(server, env=self.env_name, raise_exceptions=True)
        except ConnectionError:
            raise Exception("No visdom server detected. Run the command \"visdom\" in your CLI to "
                            "start it.")
        # webbrowser.open("http://localhost:8097/env/" + self.env_name)

        # Create the windows
        self.loss_win = None
        self.eer_win = None
        # self.lr_win = None
        self.implementation_win = None
        self.projection_win = None
        self.implementation_string = ""

    def log_params(self):
        if self.disabled:
            return
        from encoder import params_data
        from encoder import params_model
        param_string = "<b>Model parameters</b>:<br>"
        for param_name in (p for p in dir(params_model) if not p.startswith("__")):

View on GitHub (pinned to 890f3a0318)

Solutions

  1. Run `visdom` in a separate terminal and wait for 'You can navigate to http://localhost:8097', then start training.
  2. If training runs remotely/in Docker, start visdom on a reachable host and pass that server URL to the visualizer/training script.
  3. If you do not need plots, bypass the visualizer (encoder_train.py has a --no_visdom flag that uses a dummy/no-op visualizer).
  4. Check `pip show visdom` — install it if the `visdom` CLI itself is missing.

Example fix

# before
python encoder_train.py --datasets_root ~/data  # no visdom server running -> raises

# after
terminal 1: visdom
terminal 2: python encoder_train.py --datasets_root ~/data
# or, without plots:
terminal 2: python encoder_train.py --no_visdom --datasets_root ~/data
Defensive patterns

Strategy: validation

Validate before calling

import socket

def visdom_up(host="localhost", port=8097, timeout=1.0) -> bool:
    try:
        with socket.create_connection((host, port), timeout=timeout):
            return True
    except OSError:
        return False

Try / catch

try:
    viz = UiVisualizer(env_name="run1", update_every=10)
except Exception as e:
    if "visdom" in str(e):
        viz = None  # train without plots; log metrics to file instead
    else:
        raise

Prevention

When it happens

Trigger: Starting encoder_train.py (or otherwise instantiating the visualizer) while no visdom server is listening on the configured host/port (default http://localhost:8097). visdom.Visdom with raise_exceptions=True converts the failed handshake into ConnectionError, which the except clause re-raises as this Exception.

Common situations: Fresh environment where visdom was pip-installed but the server never started; training inside Docker/WSL/headless boxes where the server runs elsewhere or the port is not forwarded; server crashed mid-run and a new training run starts; firewall/port conflict on 8097.

Related errors


AI-assisted analysis of CorentinJ/Real-Time-Voice-Cloning@890f3a0318 (2026-08-15). Data as JSON: /api/errors/0b9fd6c4b0696241. Report an issue: GitHub.