Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dataset lost in google colab?

I am new to colab. I recently downloaded dataset from kaggle to google colab. In my next visit the dataset isn’t there and my kaggle installation is removed too. Does anyone know why ?

I have tried looking in /content where i remember saving and editing it!

like image 810
ankus7890 Avatar asked Jun 27 '19 16:06

ankus7890


1 Answers

When you upload files in Colab through downloading them using terminal commands or by uploading them in the runtime, the following time you will login they are lost for good. This happens because Colab doesn't (and can't) store all the files that the users upload. You can bypass this problem mounting google drive. In the "files" tab you will find a button (next to upload and refresh buttons) "mount drive". By clicking this button, a new cell will be written (you can just copy-paste the following code), containing:

from google.colab import drive
drive.mount('/content/gdrive')

This is by far the fastest method you can use to manage datasets in Colab. Just upload everything you need to your google drive storage, and use them as you prefer, like they are manually uploaded to the runtime.

like image 189
mao95 Avatar answered Oct 12 '22 15:10

mao95