{"record":{"id":"93283aa0dc4421f5","repo":"deepfakes/faceswap","slug":"the-location-self-location-does-not-exist","errorCode":null,"errorMessage":"The location '{self.location}' does not exist","messagePattern":"The location '(.+?)' does not exist","errorType":"exception","errorClass":"FaceswapError","httpStatus":null,"severity":"error","filePath":"lib/image.py","lineNumber":795,"sourceCode":"        self._queue = Queue(maxsize=queue_size)\n        self._thread = None\n        self._error_state: ErrorState | None = None\n\n    @property\n    def location(self):\n        \"\"\" str: The folder or video that was passed in as the :attr:`path` parameter. \"\"\"\n        return self._location\n\n    def _check_location_exists(self):\n        \"\"\" Check whether the input location exists.\n\n        Raises\n        ------\n        FaceswapError\n            If the given location does not exist\n        \"\"\"\n        if isinstance(self.location, str) and not os.path.exists(self.location):\n            raise FaceswapError(f\"The location '{self.location}' does not exist\")\n        if isinstance(self.location, (list, tuple)) and not all(os.path.exists(location)\n                                                                for location in self.location):\n            raise FaceswapError(\"Not all locations in the input list exist\")\n\n    def _set_thread(self):\n        \"\"\" Set the background thread for the load and save iterators and launch it. \"\"\"\n        logger.trace(\"[%s] Setting thread\", self._name)  # type:ignore[attr-defined]\n        if self._thread is not None and self._thread.is_alive():\n            logger.trace(\"[%s] Thread pre-exists and is alive: %s\",  # type:ignore[attr-defined]\n                         self._name, self._thread)\n            return\n        self._thread = FSThread(self._process,\n                                name=self.__class__.__name__,\n                                args=(self._queue, ))\n        self._error_state = self._thread.error_state\n        logger.debug(\"[%s] Set thread: %s\", self._name, self._thread)\n        self._thread.start()\n","sourceCodeStart":777,"sourceCodeEnd":813,"githubUrl":"https://github.com/deepfakes/faceswap/blob/f530cb7508ae670f6474f8a7d9c4df94705cf96b/lib/image.py#L777-L813","documentation":"FaceswapError raised by the ImagesIO base class (_check_location_exists) when a single input location (folder or video file) passed as the path argument does not exist on disk. It is a fail-fast guard before the background load/save thread starts.","triggerScenarios":"Constructing ImagesLoader (or subclass) with a typo'd path, a path on an unmounted drive, or a video file that was moved/deleted between argument validation and use.","commonSituations":"Typos in CLI -i/--input arguments, relative paths run from a different working directory, network mounts not yet attached, case-sensitive path mismatches on Linux after copying from Windows.","solutions":["Correct the path; verify with ls or os.path.exists before launching.","Use absolute paths for input locations.","If the input is on a network/external drive, confirm it is mounted before running."],"exampleFix":"import os\n\n# before\nloader = ImagesLoader('/data/face_src')  # FaceswapError if missing\n\n# after\nassert os.path.exists('/data/face_src'), 'input folder missing'\nloader = ImagesLoader('/data/face_src')","handlingStrategy":"validation","validationCode":"import os\n\nif not os.path.exists(location):\n    raise SystemExit(f'input location does not exist: {location}')\nloader = ImagesLoader(location)","typeGuard":null,"tryCatchPattern":"try:\n    loader = ImagesLoader(path)\nexcept FaceswapError as err:\n    if 'does not exist' in str(err):\n        path = prompt_user_for_valid_path()\n        loader = ImagesLoader(path)\n    else:\n        raise","preventionTips":["Always pass absolute input paths.","Validate user-supplied paths at CLI/config parse time.","Check mounts before jobs that read from network storage."],"tags":["filesystem","path","validation","io"],"backgroundTag":null,"analyzedSha":"f530cb7508ae670f6474f8a7d9c4df94705cf96b","analyzedAt":"2026-08-15T02:59:26.626Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}