williamyang1991 / DualStyleGAN

[CVPR 2022] Pastiche Master: Exemplar-Based High-Resolution Portrait Style Transfer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error on notebook

MsM512 opened this issue · comments

Hi,
On loading pre-trained model,I got this error on Colab:


UnpicklingError Traceback (most recent call last)
in <cell line: 13>()
11 generator = DualStyleGAN(1024, 512, 8, 2, res_index=6)
12 generator.eval()
---> 13 ckpt = torch.load(os.path.join(MODEL_DIR, style_type, 'generator.pt'), map_location=lambda storage, loc: storage)
14 generator.load_state_dict(ckpt["g_ema"])
15 generator = generator.to(device)

1 frames
/usr/local/lib/python3.10/dist-packages/torch/serialization.py in _legacy_load(f, map_location, pickle_module, **pickle_load_args)
1244 "functionality.")
1245
-> 1246 magic_number = pickle_module.load(f, **pickle_load_args)
1247 if magic_number != MAGIC_NUMBER:
1248 raise RuntimeError("Invalid magic number; corrupt file?")

UnpicklingError: invalid load key, '<'.