Skip to content

Swin IR fails when loading from cached model due to added _ character when downloading model #2

Description

@alejobrainz

Hello. I've been experiencing difficulties when using de SwinIR 4x model. It works fine on the first run, but after the model is cached, the model will not be found and it will display the following error:

Exception: SwinIR 4x is not a known model

I fixed it on my local install by omitting the " " to "_" replacement when downloading on the swinir_model.py:

    def load_model(self, path, scale=4):
        if "http" in path:

            #  removed the .replace(" ", "_"), bit from the model_name:
            dl_name = "%s%s" % (self.model_name, ".pth")
            filename = load_file_from_url(url=path, model_dir=self.model_path, file_name=dl_name, progress=True)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions