代码报错--------EOFError: Compressed file ended before the end-of-stream marker was reached

背景:运行LeNet识别CIFAR-10的图像的代码时,报错:

    EOFError: Compressed file ended before the end-of-stream marker was reached

解决办法:在C:Users华硕.kerasdatasets的目录下面把 cifar-10-batches-py 这个文件夹删掉

原因: 第二次运行时,报错为找不到data_batch_1 这个文件,我的cifar-10-batches-py文件夹里只有data_batch_4文件,所以大致原因是程序中下载的数据集出现丢失或者其他问题,把数据集删掉重新下载可以解决。

原文地址:https://www.cnblogs.com/sunny2eye/p/10595440.html