pytorch运行下图代码,下载mnist数据集时报错。
EOFError: Compressed file ended before the end-of-stream marker was reached
train_dataset = datasets.MNIST(
root=r'./mnist',
train=True,
download=True,
transform=transform
)
解决方法:
删除设定代码 root=r’./mnist’ 文件夹下,processed和raw子文件夹里面的所有文件,再次执行代码就不会报错。。。但下载速度依然感人,失败概率百分之90以上。。。
pytorch下载数据集慢解决方法(https://blog.csdn.net/weixin_44414948/article/details/109756003)