I am trying to load an .npz file to then run a CNN but I am having trouble loading the file that is inside a google storage bucket. I'm using the gsutil syntax but it doesn't seem to work inside jupyter. Am I just missing a library?
# load train and test dataset
def load_dataset():
# load dataset
data = load('gs://for-imet/iMet_data_unsampled.npz')
X, y = data['arr_0'], data['arr_1']
# separate into train and test datasets
trainX, testX, trainY, testY = train_test_split(X, y, test_size=0.3, random_state=1)
print(trainX.shape, trainY.shape, testX.shape, testY.shape)
return trainX, trainY, testX, testY
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-5-9cf853d8acf7> in <module>
35
36 # load dataset
---> 37 trainX, trainY, testX, testY = load_dataset()
38 # make all one predictions
39 train_yhat = asarray([ones(trainY.shape[1]) for _ in range(trainY.shape[0])])
<ipython-input-5-9cf853d8acf7> in load_dataset()
10 def load_dataset():
11 # load dataset
---> 12 data = load('gs://for-imet/iMet_data_unsampled.npz') #######################
13 X, y = data['arr_0'], data['arr_1']
14 # separate into train and test datasets
/usr/local/lib/python3.5/dist-packages/numpy/lib/npyio.py in load(file, mmap_mode, allow_pickle, fix_imports, encoding)
426 own_fid = False
427 else:
--> 428 fid = open(os_fspath(file), "rb")
429 own_fid = True
430
FileNotFoundError: [Errno 2] No such file or directory: 'gs://for-imet/iMet_data_unsampled.npz'