Platform: Colab ✅

Thanks a bunch @ilovescience! I’ll try again.

So I finished setup for colab successfully but the Practical Deep Learning for Coders, v3 says that after setting up I should see a Jupyter notebook like this

But I don’t. Am I missing something?

Hi maverick891 hope your having lots of fun today!

Your notebook will look like this:

You then have to do file > open notebook and you will get the following screen.

As far as I am aware I have I only see the screen you have shown when I run fastai on my desktop.

This is the link I have used for all the lessons in fastai part 1 V3.

https://course.fast.ai/start_colab.html#step-4-saving-your-data-files

Cheers
mrfabulous1 :smiley::smiley:

Hi everyone

I am a Data Science intern from a non Computer Science background so apologies for the noonish questions.

Does anyone have a detailed tutorial on how to follow the download.ipynb notebook using Google Colab??

I’m trying to follow the notebook and after I’ve entered the given JavaScript code snippet in the first step, the console returns “null” not too sure if that’s supposed to happen?

And even if I am on the right track I’m not sure where the images are stored with the regards to using/accessing them in Colab since it’s a different server.

Any help would be greatly appreciated.

Thanks

There is an easier way to download google images using the google-images-download python module in your jupyter notebook.
Here are the steps to download the different bears images

First install the python module. In a cell, enter the following command
!pip install google_images_download
Then in the subsequent cells, start downloadig the grizzly bears (-k grizzly argument below)
!googleimagesdownload -k grizzly -l 100
A new folder called downloads/grizzly will be created with 100 images in it (that’s the -100 argument n the command above)
Do the same thing for the other categories
!googleimagesdownload -k ‘black bear’ -l 100
!googleimagesdownload -k ‘teddy bear’ -l 100

Run the ls command
!ls downloads/
and you should have the 3 following folders
‘black bear’ grizzly ‘teddy bear’

If you are using the lesson2-download, you can update your path like this (assuming you are using Colab)
classes = [‘grizzly’, ‘black bear’, ‘teddy bear’]
path = Path(’/content/downloads’)
path.ls()

The cell output should look like this
[PosixPath(’/content/downloads/grizzly’),
PosixPath(’/content/downloads/black bear’),
PosixPath(’/content/downloads/teddy bear’)]

From there, you can just continue executing the rest of the cells.

If you want to keep the original folder names (used in lesson2-download.ipynb) you can rename the new folder names listed here above to match those of lesson2-download.ipynb notebook.

Cheers

1 Like

Dude Thank You so much! The help is much appreciated man :pray:t4::pray:t4::pray:t4:

My pleasure :slightly_smiling_face:. I’m Glad it was helpful

Good luck!

Hey guys

Anybody find a tutorial for Lesson 3 - using Kaggle API in Google Colab that’s an up to date tutorial for 2019? I tried the one listed under the lecture resources but it’s supposedly outdated.

Thanks

You can follow these steps:

First, download your kaggle.json file to Colab.

Then run these command in your Colab notebook:

! pip install kaggle --upgrade
! mkdir -p ~/.kaggle/
! cp /content/kaggle.json ~/.kaggle/
! chmod 600 /root/.kaggle/kaggle.json
path = Config.data_path()/'planet'
path.mkdir(parents=True, exist_ok=True)
! kaggle competitions download -c planet-understanding-the-amazon-from-space -f train-jpg.tar.7z -p {path}

Then run the rest of the notebook commands

Hey Farid

As usual, thanks for the help man. The following block:

path = Config.data_path()/'planet'

gives me a:
NameError: name 'Config' is not defined

you have to run this before:

from fastai.vision import *

I’m assuming that you are following along with the lesson3-planet notebook

oohh my bad. thanks my Canadian brotha :pray:t4:

No problem!

Hi, I’m trying to download my images. However, I’m constantly getting this error message:
FileNotFoundError: [Errno 2] No such file or directory: ‘/content/gdrive/My Drive/fastai-v3/data/rodents/coypus.txt’

What am I missing and/or doing wrong?


Thanks in advance.

Hi Suwilli hope all is well!

Please see this link Showing error No such file or directory: 'Text/Banded_Racer.txt' this helped another person resolve a problem just like yours.

Cheers mrfabulous1 :smiley::smiley:

Hi, mrfabulous!

Thanks, I appreciate the assistance.

Did it work for you? i have tried most of the solution found here, but it hasn’t work for me so for

It didn’t work for me. However, when I reorganized it I was able to download the images. Try organizing it this way:

Does anyone know why verify_images is only being applied to coypus and not beavers and capybaras?

A. classes = [‘beavers’, ‘capybaras’, ‘coypus’]
for c in classes:
print ( c)
verify_images(path/c, delete=True, max_size=500)
For some reason A is only being applied to coypus and not beavers and capybaras

B. classes = [‘beavers’, ‘capybaras’, ‘coypus’]
for c in classes:
print ( c)
verify_images(path/r, delete=True, max_size=500)

C. classes = [‘beavers’, ‘capybaras’, ‘coypus’]
for c in classes:
print ( c)
verify_images(path/b, delete=True, max_size=500)

B and C are being applied to beavers, capybaras, and coypus. Does anyone know why that’s happening?

Additionally, when I run data.classes only coypus appears. Am I missing a step?