Lesson 2 - Stuck! Python help needed

Hello,

I’m working through Lesson 2 but I’m stuck with the image downloads.

I get an error message saying that it can’t find the urls_black.csv file. Any guidance on where I should be saving the .csv file? Should I be creating a new file directory?

Syntax is as follows (thanks!):

folder = ‘black’
file = ‘urls_black.csv’

path = Path(‘data/bears’)
dest = path/folder
dest.mkdir(parents=True, exist_ok=True)

download_images(path/file, dest, max_pics=200)

Hi Wildman-John

had same issue yesterday. :slight_smile:

Have you downloaded the csv’s from your browser?
If you have you should upload them to the path defined.
If you cant find that folder, you could define another directory which you are able to find.

Hi, thanks for the reply!

It’s frustrating when you get stuck like this isn’t it?

After quite a bit of changing the code I seemed to have it working:

C:\fastai images\data\bears\grizzly

from fastai.vision import *

import os

os.chdir(‘C:\fastai images’)

folder = ‘grizzly’
file = ‘urls_grizzly.csv’

path = Path(‘data/bears’)
dest = path/folder
dest.mkdir(parents=True, exist_ok=True)

path.ls()

I’ve tried out using a different set of images but my error rate seems to be around the 20%. I guess that means they’re too similar…

Thanks again!

@wildman Please be careful to post the questions in the right forum category. This section is for Part 2-2019, I believe the question belongs to #part1-v3

This is one of the most common pitfalls. The best way to work your way around this is using the path.ls() function that has been added.
Another hint to it is when the error prompt mentions that the system cannot find a file. It usually means that the directory doesn’t have it or there is a misspell.

Thanks! I’m still finding my way around. Hopefully in the not too distant future I’ll be more skilled and knowledgeable!

Cheers :slight_smile:

I have faced the same problem a month ago, then I called one of my faculty who teaches in Universal Informatics Indore which is a Machine Learning Training In Indore as well best Python Training Institute in Indore. He sorted my problem and rid me out of it.