mmagic
mmagic copied to clipboard
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
Runtime Error while inferencing with trained models. Command in Windows cmd:
python tools/test.py ^
configs/restorers/basicvsr_plusplus/basicvsr_plusplus_360.py ^
work_dirs/formal_basicvsr_plusplus_360new_cb/iter_90000.pth ^
--save-path result/basicvsr_plusplus_cb
Error message:
load checkpoint from local path: work_dirs/formal_basicvsr_plusplus_360new_cb/iter_90000.pth
Traceback (most recent call last):
File "tools/test.py", line 142, in <module>
main()
File "tools/test.py", line 99, in main
_ = load_checkpoint(model, args.checkpoint, map_location='cpu')
File "D:\Anaconda3\envs\pytorch\lib\site-packages\mmcv\runner\checkpoint.py", line 581, in load_checkpoint
File "D:\Anaconda3\envs\pytorch\lib\site-packages\mmcv\runner\checkpoint.py", line 302, in load_from_local
checkpoint = torch.load(filename, map_location=map_location)
File "D:\Anaconda3\envs\pytorch\lib\site-packages\torch\serialization.py", line 600, in load
with _open_zipfile_reader(opened_file) as opened_zipfile:
File "D:\Anaconda3\envs\pytorch\lib\site-packages\torch\serialization.py", line 242, in __init__
super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
tried on Google Colab and still meet the same problem
Seems some defects with your pth file. Would you please try replacing iter_90000.pth
with other checkpoints?
Seems some defects with your pth file. Would you please try replacing
iter_90000.pth
with other checkpoints?
tried but still have the same problem
For example, replacing the checkpoint with the one downloaded from our readme page, cause the same error?
For example, replacing the checkpoint with the one downloaded from our readme page, cause the same error?
the checkpoint downloaded from readme page has no problem, but the checkpoints from my training all have the same problem
@cjj490168650 did you manage to fix the issue?
Please check this issue. @LeoXing1996
Hey @cjj490168650, seems that your model is not saved correctly. Can you provide a minimum script demonstrating the error?
Closing due to inactivity, please reopen if there are any further problems.