PytorchStreamReader failed reading zip archive: failed finding central directory

 

网友给的方法:

解决方法1:
in 1.7:

torch.save(model_.state_dict(), 'model_best_bacc.pth.tar', _use_new_zipfile_serialization=False)
 

解决方法2:

torch.load('model_best_bacc.pth.tar',map_location='cpu')

face_alignment_net = torch.jit.load(model_path, map_location="cpu")
 

 

但是我这情况是,模型是网络开源的,自己没法重新保存。

后来找到原因
pth没有下载完整

 

解决方法:

重新上传或者下载pth文件

 

你可能感兴趣的:(pytorch知识宝典)