1. 程式人生 > >代碼報錯--------EOFError: Compressed file ended before the end-of-stream marker was reached

代碼報錯--------EOFError: Compressed file ended before the end-of-stream marker was reached

nbsp 數據集 sets cifar-10 背景 for 二次 compress end

背景:運行LeNet識別CIFAR-10的圖像的代碼時,報錯:

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

解決辦法:在C:\Users\華碩\.keras\datasets的目錄下面把 cifar-10-batches-py 這個文件夾刪掉

原因: 第二次運行時,報錯為找不到data_batch_1 這個文件,我的cifar-10-batches-py文件夾裏只有data_batch_4文件,所以大致原因是程序中下載的數據集出現丟失或者其他問題,把數據集刪掉重新下載可以解決。

代碼報錯--------EOFError: Compressed file ended before the end-of-stream marker was reached