RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory torch.load
Closed this issue · 0 comments
Hi,
I trained the CycleGAN model with the given AF2HE dataset (7309 pairs).
The training command:
python train.py --dataroot ./datasets/AF2HE_datasets --name AF2HE --model cycle_gan --input_nc 1 --output_nc 3 --lambda_identity 0.0 --gpu_ids 0 --load_size 512 --crop_size 512 --display_winsize 512
However, when I used the trained model (100_net_D_A.pth), I receive the following error:
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory torch.load
The testing command:
python test.py --dataroot ./datasets/AF2HE_datasets --name AF2HE --model cycle_gan --input_nc 1 --output_nc 3 --gpu_ids 0 --load_size 512 --crop_size 512 --display_winsize 512 --num_test 100
The internet says it's caused by checkpoint file corruption. I don't know how it can be corrupted.
I have checked the code and compared it with the original CycleGAN code, there is nothing suspicious.
Is there any possible cause for this error? Could it be PyTorch version mismatch? I used PyTorch 2.1.0, while the README says PyTorch 1.3.1 is used.