{"record":{"id":"eb5dccabe74d17a6","repo":"babysor/MockingBird","slug":"no-visdom-server-detected-run-the-command-visdom","errorCode":null,"errorMessage":"No visdom server detected. Run the command \"visdom\" in your CLI to start it.","messagePattern":"No visdom server detected\\. Run the command \"visdom\" in your CLI to start it\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"models/encoder/visualizations.py","lineNumber":53,"sourceCode":"        print(\"Updating the visualizations every %d steps.\" % update_every)\n        \n        # If visdom is disabled TODO: use a better paradigm for that\n        self.disabled = disabled    \n        if self.disabled:\n            return \n        \n        # Set the environment name\n        now = str(datetime.now().strftime(\"%d-%m %Hh%M\"))\n        if env_name is None:\n            self.env_name = now\n        else:\n            self.env_name = \"%s (%s)\" % (env_name, now)\n        \n        # Connect to visdom and open the corresponding window in the browser\n        try:\n            self.vis = visdom.Visdom(server, env=self.env_name, raise_exceptions=True)\n        except ConnectionError:\n            raise Exception(\"No visdom server detected. Run the command \\\"visdom\\\" in your CLI to \"\n                            \"start it.\")\n        # webbrowser.open(\"http://localhost:8097/env/\" + self.env_name)\n        \n        # Create the windows\n        self.loss_win = None\n        self.eer_win = None\n        # self.lr_win = None\n        self.implementation_win = None\n        self.projection_win = None\n        self.implementation_string = \"\"\n        \n    def log_params(self):\n        if self.disabled:\n            return \n        from models.encoder import params_data\n        from models.encoder import params_model\n        param_string = \"<b>Model parameters</b>:<br>\"\n        for param_name in (p for p in dir(params_model) if not p.startswith(\"__\")):","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/models/encoder/visualizations.py#L35-L71","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run `visdom` in a separate CLI/shell and wait for 'You can navigate to http://localhost:8097'","If visdom is on a non-default port/host, pass the correct server URL to the Visualizations constructor","Verify connectivity: curl http://localhost:8097 or open it in a browser","Disable visualization in your training config if plotting is not needed"],"exampleFix":"# before\nvis = Visualizations(env_name='dev')  # raises: No visdom server detected\n\n# after (terminal 1)\n# $ visdom\n# terminal 2\nvis = Visualizations(env_name='dev')","handlingStrategy":"validation","validationCode":"import socket\ndef visdom_up(host='localhost', port=8097, timeout=1):\n    with socket.socket() as s:\n        s.settimeout(timeout)\n        return s.connect_ex((host, port)) == 0\nif not visdom_up():\n    print('Start visdom first: run `visdom`')","typeGuard":null,"tryCatchPattern":"try:\n    vis = Visualizations(env_name='dev')\nexcept Exception as e:\n    if 'visdom server' in str(e):\n        logging.warning('Disabling live visualization')\n        vis = None\n    else:\n        raise","preventionTips":["Run `visdom` in a dedicated terminal before starting training","Add a connectivity check on port 8097 before constructing Visualizations","Make downstream code tolerate vis=None (no plotting)"],"tags":["visdom","visualization","connection","training-monitoring"],"backgroundTag":"connection-refused","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}