Platform: Colab (Free; $10/month Pro)

You do not, correct :slight_smile: (just doing it that way required more pictures, didn’t have the time at the moment :/) if someone wants to update it with the second option (that) with visuals that’d be fantastic!

2 Likes

@Albertotono it’s been fixed :slight_smile:

1 Like

i did try that but it still asked fro the token ( only difference was i didn’t have to copy paste

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

What am i missing ?

do you want to open one for requirements.txt too ? @muellerzr

Remind me again what we needed updated for requirements? (Lots of messages, working on following as best I can :sweat_smile:)

If you’re not in a notebook cell it’ll actually give a pop up window asking to sign in and that’s it

haha right now we are doing !pip install fastai2>=0.0.11 graphviz ipywidgets matplotlib nbdev>=0.2.12 pandas scikit_learn azure-cognitiveservices-search-imagesearch sentencepiece.
All this was sitting in requirements.txt in fastbook.

2 Likes

Submitted :slight_smile:

1 Like

Here is how you easily mount Google Drive to Colab (from here):

There is one major caveat: You can only do this for new notebooks. Therefore, if you are using the fastai notebooks, you will have to select all cells and copy (if in command mode, it’s just A followed by C) and paste into a new notebook (paste using P).

The major advantage though is that you don’t have to copy and paste a long special token, and the Drive will always be mounted when you initialize the notebook runtime.

For more Colab tips, be sure to follow them on Twitter (or check their feed once in a while :wink: )

4 Likes

Ah i see, that is the difference. Thank you.

For ease and safety create a symbolic link to your course-v4 directory on your google drive.

!ln -s /content/drive/My\ Drive/fastai/course-v4/ /content/gdrive
(depending on your paths)

Does it work with either scenarios?:

  • Open from GitHub
  • Open directly from Google Drive

Unfortunately, I just tried both of these right now, and it doesn’t work (it will use the mount google drive code cell instead). However, it is pretty easy to copy and paste into a new notebook. It’s definitely a preference. But for me I prefer the new option because that way I don’t have to copy and paste a token every time I start a new runtime.

2 Likes

Thanks for investigating!

1 Like

I edited the wiki post at the top to include this information. Hope that’s fine.

2 Likes

could you explain more about this please,
so we would have to do this in each of the ipynb we are working in?
what woul the command be if it is intro.ipynb that i want to get running which is in /content/drive/My\ Drive/fastai/course-v4/nbs , what should the LINK be?
!ln -s /content/drive/My\ Drive/fastai/course-v4/nbs/intro.ipynb LINK
Thank you

I think we’d need to do it in every notebook you work in as the server changes each time?

After creating the symbolic link all course-v4 content on your google drive will be available in /content/gdrive.

So /content/gdrive/nbs/intro.ipynb.

Google linux symbolic link for more info.

3 Likes

Another caveat of Colab is that accessing a dataset from a mounted Google Drive is quite slow. I noticed this when training DL models with images as input. It was faster to download the dataset from a URL, unpack, and use it.

Correct, accessing the dataset from google drive means you access it over network which is much slower that copying the dataset to local and getting it from a ram drive or an ssd.

If you want to automate everything you could do it with rsync, if you like to juggle chain saws.