Lesson2-download: download_images command not seeing full file path

(Jeffrey Hall) #1

I’m a complete newbie in this course, so this is my first time reaching out for help. I’m working on “Lesson2-download” and have successfully completed the first several cells to create the image folder structure.

For my assignment, I’m doing an analysis of three types of catfish: blue, channel, and flathead. For each, I created the CSV: data\catfish<type><type>_catfish.csv":

image

image

image

image

However, I keep getting this error:

I’ve tried different computers and browsers, but to no avail. I’ve also tried renaming the files to .txt, but that didn’t help either. I’ve even renamed the “data/catfish” path to the full “tutorials/fastai/course-v3/nbs/dl1/data/catfish” path, but that didn’t work, either.

No matter what I try, it tries to find the file in the “data\catfish” folder. I’ve even tried modifying the “folder” variables to include the subfolder (i.e. Path(‘data/catfish/blue’), but it then reports the path correctly while still claiming the file doesn’t exist.

What am I doing wrong?

Thanks!

Jeff

2 Likes

#2

HI layer8man hope your having a jolly day!
And a big thank you for making your question clear and concise.

Please see image of when I did this lesson.


Your csv files seem to be in the directories where the images will be saved to.

Placing all three of your csv files in the catfish folder will probably solve your problem.

Cheers mrfabulous1 :smiley::smiley:

1 Like

(Jeffrey Hall) #3

That worked, thank you very much! I appreciate your guidance. :smiley:

1 Like

(Lou) #4

This thread was very helpful - I had the same issue and I figured out by trial and error that all 3 of my txt files of the URL had to be in the parent folder (catfish or bears here) and not the subfolders (black or blue.)

However, I did have some trouble in determining what order to run different parts of the code.

I had no issue creating the folders, but once they are created, what bits of code should be run and in what order? I feel like I probably ran some code that didn’t have to be run again, and I don’t want to create bad habits. I had to run everything three times to get the images in each folder.

0 Likes

#5

Hi learningML89 hope you had a beautiful day today.

You are correct. If you are running the section of code in my image above you have to run the code for each class as the folder and file names are declared using name “folder” and “file”. If you look at the image you will see it says You will beed to run the cell once for each category.

you run
code cell 1
code cell 4
code cell 2
code cell 4
code cell 3
code cell 4

your could rewrite the code using a list and a for loop.

Hope this helps mrfabulous1 :smiley::smiley:

0 Likes