Google Colab: where do we upload the image file?

Stumbling through Chapter 1 of the book in Google Colab. Made some edits based on previous Q&A in the forums … what am I still missing?

I still have a conceptual gap about what if anything is running “on” my laptop - versus on Google Cloud. E.g. when I execute: ‘!pip install -Uqq fastbook’, where is that installing?

I have an image of a cat. Where am I supposed to upload it to, i.e. where is the images directory?

Any guidance much appreciated - thanks.

Here are instructions I provided in another forum post on a couple of ways to upload an image file to use in your scenario.

Regarding your question about colab vs local—by default, nothing you run in colab is running on your laptop. From their docs:

Code is executed in a virtual machine private to your account. Virtual machines are deleted when idle for a while, and have a maximum lifetime enforced by the Colab service.

There is a way to connect your colab notebook to a local runtime (which I just learned about when googling around after reading your post). I have never had a reason to do so since I don’t have a local GPU and run all my fastai coursework either in Colab or Kaggle.

1 Like

Super helpful - thank you! The magic incantations worked.

run all my fastai coursework either in Colab or Kaggle

You follow the book in Colab and do the “course lessons” in Kaggle - is that the more straightforward and beginner-friendly way?

1 Like

I do almost everything in Colab (take notes, running the book and lecture code, “Further Research” items at the end of each chapter), although sometimes I’ll work in Kaggle. For example, in Lesson 6, Jeremy shares links to different Live Coding videos in which he walks through his process for working on and submitting results to a Kaggle competition—I code along these videos in a Kaggle notebook since I’m submitting my results to Kaggle anyways, although there’s nothing that requires me to use Kaggle, I could do this work in Colab and then submit my notebook and results differently.

I would say the most straightforward and beginner-friendly way is to use Colab for the book code (since the chapters are already readily available in Colab), and use Kaggle when Jeremy uses Kaggle in the lecture videos (as he does for the Is it a bird example in Lesson 1).

Also, there is a Lesson 0 fastai course video from the 2020 version of the course that I recommend you watch if you haven’t come across it before.

1 Like

Hi

Use Chrome go to Google and login.
Next go to colab

image

Click on the symbol left of the eye (mount/unmount)

You now have a google drive.

Hoover over drive and three dots appears

image

Select upload from your local machine.

You can then access the data.

Regards Conwyn

1 Like

Hello,

I’ve made for U a mini-tutorial, here’s a screenshot of it:

Have fun :slight_smile:

1 Like