jianzhangcs / panini

Panini-Net: GAN Prior based Degradation-Aware Feature Interpolation for Face Restoration, AAAI 2022 (PyTorch Code)
111 stars 13 forks source link

colab error in sr #6

Open loboere opened 2 years ago

loboere commented 2 years ago

!python demo/restoration_single_face_demo.py --config configs/panini_sr.py --checkpoint checkpoint/panini_sr_latest.pth --img_path /content/panini/examples/SR_result/00001.png --save_path examples/SR_result/result.png

load checkpoint from http path: http://download.openmmlab.com/mmgen/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth 2022-04-26 05:22:09,092 - mmedit - INFO - Load pretrained model from http://download.openmmlab.com/mmgen/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth 0 1 2 3 load checkpoint from http path: http://download.openmmlab.com/mmgen/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth 2022-04-26 05:22:10,933 - mmedit - INFO - Load pretrained model from http://download.openmmlab.com/mmgen/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth 2022-04-26 05:22:13,327 - mmedit - INFO - load checkpoint from torchvision path: torchvision://vgg16 load checkpoint from local path: checkpoint/panini_sr_latest.pth Traceback (most recent call last): File "demo/restoration_single_face_demo.py", line 65, in main() File "demo/restoration_single_face_demo.py", line 48, in main args.config, args.checkpoint, device=torch.device('cuda', args.device)) File "./mmedit/apis/train.py", line 45, in init_model checkpoint = load_checkpoint(model, checkpoint) File "/usr/local/lib/python3.7/dist-packages/mmcv/runner/checkpoint.py", line 581, in load_checkpoint checkpoint = _load_checkpoint(filename, map_location, logger) File "/usr/local/lib/python3.7/dist-packages/mmcv/runner/checkpoint.py", line 520, in _load_checkpoint return CheckpointLoader.load_checkpoint(filename, map_location, logger) File "/usr/local/lib/python3.7/dist-packages/mmcv/runner/checkpoint.py", line 285, in load_checkpoint return checkpoint_loader(filename, map_location) File "/usr/local/lib/python3.7/dist-packages/mmcv/runner/checkpoint.py", line 302, in load_from_local checkpoint = torch.load(filename, map_location=map_location) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 713, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 920, in _legacy_load magic_number = pickle_module.load(f, pickle_load_args) EOFError: Ran out of input

jianzhangcs commented 2 years ago

Thank you for your attention and questions! It looks like you loaded an empty file. Maybe you can check that the .pth is fully downloaded.