BadZipFile: File is not mail, importing keras

When I run this code, I got the following error . I tried different methods to get rid of this problem, but could not.

May I ask someone who can help me solve this problem. There are some solutions to the same problem, but I could not get their points to fix it.

import numpy

from keras.datasets import imdb
(X_train, y_train), (X_test, y_test) = imdb.load_data()

X = numpy.concatenate((X_train, X_test), axis=0)

y = numpy.concatenate((y_train, y_test), axis=0)

Using Theano backend.

BadZipFile    
/home/maaz/anaconda3/lib/python3.6/zipfile.py in _RealGetContents(self)
   1165             raise BadZipFile("File is not a zip file")
   1166         if not endrec:
-> 1167             raise BadZipFile("File is not a zip file")
   1168         if self.debug > 1:
   1169             print(endrec)

BadZipFile: File is not a zip file                            Traceback (most recent call 

BadZipFile: File is not a zip file
+4
source share
2 answers

This could happen when the previous download stopped for some reason, which led to bad zip files in cache caches. Try clearing the data set cache: rm ~ / .keras / datasets / *

+12

. , , . , . Mac OS, ? .

. rm -R.keras/datasets bash.

0

Source: https://habr.com/ru/post/1677567/


All Articles