deepfakes/faceswap · error · FaceswapError

Not all locations in the input list exist

Error message

Not all locations in the input list exist

What it means

FaceswapError raised when ImagesIO receives a list/tuple of input locations and at least one of them does not exist. Unlike the single-path error it does not name the missing entry, so you must diff the list against the filesystem yourself.

Solutions

  1. Diff the list against disk to find the missing entry: [p for p in paths if not os.path.exists(p)].
  2. Fix or remove the missing path and retry.
  3. Use absolute paths and verify mounts before multi-location runs.

Example fix

import os

# before
loader = ImagesLoader(['/data/a', '/data/b'])  # FaceswapError, which one?

# after
missing = [p for p in ['/data/a', '/data/b'] if not os.path.exists(p)]
assert not missing, f'missing locations: {missing}'
loader = ImagesLoader(['/data/a', '/data/b'])
Defensive patterns

Strategy: validation

Validate before calling

import os

missing = [p for p in locations if not os.path.exists(p)]
if missing:
    raise SystemExit(f'these input locations are missing: {missing}')

Try / catch

try:
    loader = ImagesLoader(locations)
except FaceswapError as err:
    if 'Not all locations' in str(err):
        locations = [p for p in locations if os.path.exists(p)]
        loader = ImagesLoader(locations)
    else:
        raise

Prevention

When it happens

Trigger: Passing multiple folders/videos to ImagesLoader (e.g. several extraction sources) where one entry is misspelled, unmounted, or deleted.

Common situations: Merging datasets from several directories where one was renamed; shell glob expansion that matched nothing; mixed mount points where one share dropped.

Related errors


AI-assisted analysis of deepfakes/faceswap@f530cb7508 (2026-08-15). Data as JSON: /api/errors/92512f653aab2c5d. Report an issue: GitHub.

Appendix: source

Thrown at lib/image.py:798

    @property
    def location(self):
        """ str: The folder or video that was passed in as the :attr:`path` parameter. """
        return self._location

    def _check_location_exists(self):
        """ Check whether the input location exists.

        Raises
        ------
        FaceswapError
            If the given location does not exist
        """
        if isinstance(self.location, str) and not os.path.exists(self.location):
            raise FaceswapError(f"The location '{self.location}' does not exist")
        if isinstance(self.location, (list, tuple)) and not all(os.path.exists(location)
                                                                for location in self.location):
            raise FaceswapError("Not all locations in the input list exist")

    def _set_thread(self):
        """ Set the background thread for the load and save iterators and launch it. """
        logger.trace("[%s] Setting thread", self._name)  # type:ignore[attr-defined]
        if self._thread is not None and self._thread.is_alive():
            logger.trace("[%s] Thread pre-exists and is alive: %s",  # type:ignore[attr-defined]
                         self._name, self._thread)
            return
        self._thread = FSThread(self._process,
                                name=self.__class__.__name__,
                                args=(self._queue, ))
        self._error_state = self._thread.error_state
        logger.debug("[%s] Set thread: %s", self._name, self._thread)
        self._thread.start()

    def _process(self, queue):
        """ Image IO process to be run in a thread. Override for loader/saver process.

View on GitHub (pinned to f530cb7508)