Dataset lost in google colab?
Asked Answered
H

1

8

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!

Halloween answered 27/6, 2019 at 16:0 Comment(0)
J
6

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.

Jillion answered 28/6, 2019 at 9:38 Comment(2)
Thank!! this was helpful ! Do you have always install all the programs every time too .. for example !kaggle??Halloween
Yes, unfortunately. I had the same problem some time ago, because I had to use tensorflow version 1.12 as a constraint, and had to download all the packages like specific version of cuda, etc every time...Jillion

© 2022 - 2024 — McMap. All rights reserved.