I have two different files and on the first, I tried to save data to file as:

np.save(open(Q1_TRAINING_DATA_FILE, 'wb'), q1_data)


On second file, i'm trying to load it the same way using:

q1_data = np.load(open(Q1_TRAINING_DATA_FILE, 'rb'))


I then get the error:

FileNotFoundError: [Errno 2] No such file or directory: 'q1_train.npy'


I searched my google drive but couldn't find this file.

Edit: I'm trying to run below Kaggle problem on Colab platform. The author has two files (Jupyter and nbs) - one to prepare and 2nd to train. The step on nb1 where it's creating some files - which later to be consumed by file 2 is where I'm struck.

• What is your data format? – Media Feb 18 '18 at 19:32
• I just formatted the question to add more info. Concretely, there are files generated in 1st nb which 2nd nb will use. The Colab doesn't give any error but I'm unable to find the place where it's saving them. – vikbehal Feb 18 '18 at 19:36
• type !ls in the jupyter and see the current files, what do you see? – Media Feb 18 '18 at 19:56
• You can setup an automatic real time sync from colab to Google Drive using clouderizer. No python code is needed to upload it manually to Google Drive. Watch this youtube.com/watch?v=9ntDy0H6D_I – Prakash Gupta May 7 '18 at 10:49

Based on what I've seen and experienced, the best way is to store and retrieve your data from your drive account. Actually your question is a bit unclear but first I say, try to use the following command to see the current files in your directory, although I guess each 12 hours they all would be deleted automatically.

!ls


Anyway I recommend the following instructions:

!pip install -U -q PyDrive

import tensorflow as tf
import timeit

config = tf.ConfigProto()
config.gpu_options.allow_growth = True

# Authenticate and create the PyDrive client.
auth.authenticate_user()


Use the following code to get the id of contents in your drive:

file_list = drive.ListFile({'q': "'root' in parents and trashed=false"}).GetList()
for file1 in file_list:
print('title: %s, id: %s' % (file1['title'], file1['id']))


Put the id of the desired file, e.g. a typical text file, in the content of the following dictionary with id key:

downloaded = drive.CreateFile({'id': 'the id of typical text file'})


Till now you have copied the text file, then you have to write it in your Colab disk using the following code:

text_file = open("your desired name.txt", "w")
text_file.write(file)
text_file.close()


# Create & upload a file.

uploaded = drive.CreateFile({'title': 'filename.csv'})


from google.colab import files