babysor/MockingBird · error · Exception

No visdom server detected. Run the command "visdom" in your

Error message

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

What it means

Raised when the Visdom visualization client cannot establish a connection to a Visdom server. The constructor visdom.Visdom(...) with raise_exceptions=True raises a ConnectionError when the server (default http://localhost:8097) is not running, and this code re-raises it as a generic Exception with instructions to start visdom.

Source

Thrown at models/encoder/visualizations.py:53

        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 models.encoder import params_data
        from models.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 28dc5e14f1)

Solutions

  1. Run `visdom` in a separate CLI/shell and wait for 'You can navigate to http://localhost:8097'
  2. If visdom is on a non-default port/host, pass the correct server URL to the Visualizations constructor
  3. Verify connectivity: curl http://localhost:8097 or open it in a browser
  4. Disable visualization in your training config if plotting is not needed

Example fix

# before
vis = Visualizations(env_name='dev')  # raises: No visdom server detected

# after (terminal 1)
# $ visdom
# terminal 2
vis = Visualizations(env_name='dev')
Defensive patterns

Strategy: validation

Validate before calling

import socket
def visdom_up(host='localhost', port=8097, timeout=1):
    with socket.socket() as s:
        s.settimeout(timeout)
        return s.connect_ex((host, port)) == 0
if not visdom_up():
    print('Start visdom first: run `visdom`')

Try / catch

try:
    vis = Visualizations(env_name='dev')
except Exception as e:
    if 'visdom server' in str(e):
        logging.warning('Disabling live visualization')
        vis = None
    else:
        raise

Prevention

When it happens

Trigger: Instantiating the Visualizations class (models/encoder/visualizations.py:53) while no visdom server is listening, e.g. during training startup when umap/loss/eer plotting is enabled.

Common situations: Forgot to run `visdom` in a terminal; visdom installed but server started on a different port; running in Docker/remote environment where localhost:8097 is unreachable; visdom package version mismatch.


AI-assisted analysis of babysor/MockingBird@28dc5e14f1 (2026-08-27). Data as JSON: /api/errors/eb5dccabe74d17a6. Report an issue: GitHub.