fix for one error with BSRGAN, though it fails to work anyway #1109

This commit is contained in:
AUTOMATIC 2022-09-30 18:55:46 +03:00
parent 43c87ef0fc
commit ac21d308cd
1 changed files with 1 additions and 2 deletions

View File

@ -67,9 +67,8 @@ class UpscalerBSRGAN(modules.upscaler.Upscaler):
else:
filename = path
if not os.path.exists(filename) or filename is None:
print("Unable to load %s from %s" % (self.model_dir, filename))
print(f"BSRGAN: Unable to load model from {filename}", file=sys.stderr)
return None
print("Loading %s from %s" % (self.model_dir, filename))
model = RRDBNet(in_nc=3, out_nc=3, nf=64, nb=23, gc=32, sf=2) # define network
model.load_state_dict(torch.load(filename), strict=True)
model.eval()