Shuyib (16) [Avatar] Offline
#1
Hi,

I'm using [iPython 5.1.0, python 3.5.2, Keras 2.0.4, tensorflow 1.1.0 and theano 0.9.0]

I tried importing the imdb data with the code provided in the book. But i kept getting a BadZipFile: File is not a zip file error. Is anyone else experiencing this? I checked out https://keras.io/datasets/ and used this code and it downloaded the data correctly. Last time, i did it, i had to interrupt the download due to a slow internet connection. Maybe this could've cause the problem now.

from keras.datasets import imdb
   ...: 
   ...: (train_data, train_labels), (test_data, test_labels) = imdb.load_data(pa
   ...: th="imdb.zip",num_words=10000)
gfred (8) [Avatar] Offline
#2
I hope you set up your deep learning tools in a virtualenv or conda. Navigate to the folder $/ keras/datasets/ and delete the IMDb folder... Then try again
Shuyib (16) [Avatar] Offline
#3
I am. Yes, it works now.
543749 (3) [Avatar] Offline
#4
gfred wrote:I hope you set up your deep learning tools in a virtualenv or conda. Navigate to the folder $/ keras/datasets/ and delete the IMDb folder... Then try again
543749 (3) [Avatar] Offline
#5
code
[ 34 KB ]
gfred wrote:I hope you set up your deep learning tools in a virtualenv or conda. Navigate to the folder $/ keras/datasets/ and delete the IMDb folder... Then try again

i can't load the dataset, with the coad as the book, the output is: Exception: URL fetch failure on https://s3.amazonaws.com/text-datasets/imdb.npz: None -- [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
gfred (8) [Avatar] Offline
#6
I think you should leave out the named parameter 'path' of the load_data() function, then try again.

EDIT: i tried it exactly as you have shown and that also worked for me. my guess is that it might be an internet connection problem.
543749 (3) [Avatar] Offline
#7
gfred wrote:I think you should leave out the named parameter 'path' of the load_data() function, then try again.

it still doesn't work.
my code is:
In [34]: from keras.datasets import imdb
...: (x_train, y_train), (x_test, y_test) = imdb.load_data(path="imdb.npz",num_words=None,skip_top=0,maxlen=None,seed=113,start_char=1,oov_char=2,index_from=3)

it still shows:
URL fetch failure on https://s3.amazonaws.com/text-datasets/imdb.npz: None -- [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond