2020 Lesson 2 / 02_production FileNotFoundError images/grizzly.jpg

Hello,

I was seeing a minor issue with some of the example code in the ‘Gathering Data’ section of 02_production.

The cell reads:
dest = ‘images/grizzly.jpg’
download_url(ims[0], dest)

This fails with a File Not Found error.

I’m using Google Colab, and the courses v4 repo.
I think the issue was the fact there was no ‘images’ folder.
and in Colab I could not just use a terminal to create one.

The solution appeared to be just:
import os
os.mkdir(‘images’)

The above seemed to stop the issue.
Thanks
Pete

11 Likes

Thanks! This worked for me too as I got the same issue in paperspace!

Andy

Thanks Andy - sport on

Anyone wondering where they can locate their “images” directory can use the following code

os.path.abspath("images")    

Also you can list all the files in your directory

os.listdir("images")

I just found out these.

Hello i had a simillar problem than i fixed it like you described,
but i have the problem that when i download the images it does download the images but my
fns = get_image_files(path)
fns
has no elements in it the output is : (#0) [] instead of smthing like:
[Path(‘bears/black/00000095.jpg’),Path(‘bears/black/00000133.jpg’),Path(‘bears/black/00000062.jpg’),Path(‘bears/black/00000023.jpg’),Path(‘bears/black/00000029.jpg’),Path(‘bears/black/00000094.jpg’),Path(‘bears/black/00000124.jpg’),Path(‘bears/black/00000056.jpeg’),Path(‘bears/black/00000046.jpg’),Path(‘bears/black/00000045.jpg’)…
probably i have selected the wrong or no directory

Thanks, Pete! This helped me.