webui.py channels last support

This commit is contained in:
C43H66N12O12S2 2022-09-12 16:26:42 +03:00 committed by GitHub
parent 11e648f6c7
commit fbeadef130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,8 @@ def load_model_from_config(config, ckpt, verbose=False):
if len(u) > 0 and verbose:
print("unexpected keys:")
print(u)
if cmd_opts.channelslast:
model = model.to(memory_format=torch.channels_last)
model.eval()
return model