PytorchStreamReader failed reading zip archive: failed finding central directory (pytorch下载预训练模型失败)

from torchvision import models

model2 = models.resnet18(pretrained=True)

 这时报错:PytorchStreamReader failed reading zip archive: failed finding central directory

解决:重新下载

model2 = models.resnet18(pretrained=True)下载的模型都会保存在本地

PytorchStreamReader failed reading zip archive: failed finding central directory (pytorch下载预训练模型失败)_第1张图片

可以用everything找到相应文件

找到相应时间下载的文件。

如果下载resnet18报错,则删除resnet18,再用model2 = models.resnet18(pretrained=True)

重新下载,下载完成后不会报错

你可能感兴趣的:(pytorch,深度学习,神经网络,python,人工智能)