{"record":{"id":"0b9fd6c4b0696241","repo":"CorentinJ/Real-Time-Voice-Cloning","slug":"no-visdom-server-detected-run-the-command-visdo","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":"warning","filePath":"encoder/visualizations.py","lineNumber":54,"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 encoder import params_data\n        from 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":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/CorentinJ/Real-Time-Voice-Cloning/blob/890f3a03187195b9829db2079b75c2ba2ab0405c/encoder/visualizations.py#L36-L72","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run `visdom` in a separate terminal and wait for 'You can navigate to http://localhost:8097', then start training.","If training runs remotely/in Docker, start visdom on a reachable host and pass that server URL to the visualizer/training script.","If you do not need plots, bypass the visualizer (encoder_train.py has a --no_visdom flag that uses a dummy/no-op visualizer).","Check `pip show visdom` — install it if the `visdom` CLI itself is missing."],"exampleFix":"# before\npython encoder_train.py --datasets_root ~/data  # no visdom server running -> raises\n\n# after\nterminal 1: visdom\nterminal 2: python encoder_train.py --datasets_root ~/data\n# or, without plots:\nterminal 2: python encoder_train.py --no_visdom --datasets_root ~/data","handlingStrategy":"validation","validationCode":"import socket\n\ndef visdom_up(host=\"localhost\", port=8097, timeout=1.0) -> bool:\n    try:\n        with socket.create_connection((host, port), timeout=timeout):\n            return True\n    except OSError:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    viz = UiVisualizer(env_name=\"run1\", update_every=10)\nexcept Exception as e:\n    if \"visdom\" in str(e):\n        viz = None  # train without plots; log metrics to file instead\n    else:\n        raise","preventionTips":["Start visdom as part of your training launch script and wait for the port to accept connections.","Use encoder_train.py's --no_visdom in CI, Docker, or headless runs.","Log metrics to a file as well as visdom so plots are never a hard dependency."],"tags":["visualization","visdom","training","network","startup"],"backgroundTag":null,"analyzedSha":"890f3a03187195b9829db2079b75c2ba2ab0405c","analyzedAt":"2026-08-15T02:15:13.202Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}