Lesson 2 FileNotFoundError

Hello. I’ve looked through the other threads and couldn’t find anything that worked for me; I apologize if there’s a solution already posted.

I’ve uploaded the three csv files into the jupyter notebook that I’m running on Paperspace. Here’s a photo of the file and its path:

Here’s the part of my notebook that defines the folder/file:

(the path.ls() doesn’t show the teddys path, and I’m not sure why. Might be part of the problem).

Finally, here’s a picture of the error:

You can see that the path matches the path shown in the first image, but it’s still saying the file couldn’t be found. What should I do?

If you don’t want to waste your time waiting someone to help you and solve this problem in another way(or the way you should use).

That is just download total of 150 bear images. 50 on black, 50 on teddys, and 50 on grizzly. After that, put them, 50 each, into three different folders. Next, upload them into storage folder in your case because I see, “path = Path(’'storage/bears”). At the end, run all the code except the code for downloading the image.

Let me tell you why I suggest this. Your issue is downloading image from google with a short cut. But that short cut runs into problems. Thus, why don’t you just pick the images, download them by yourself, and upload them by yourself.

Thank you for the suggestion. I’ll definitely try that to get moving forward on the lesson, but I’d still like to be able to download them the way the lesson shows so that I can work with larger quantities of images.

Here is another suggestion. If you really used my way, you can try to use your own dataset. You can download 3 different types of things instead of 3 different types of beer. Upload them, train them, and see the accurate your got.

That’s a good idea! I can also use my own dataset with the method where I upload the image urls instead of the images themselves; I just don’t know why it’s saying the filepath doesn’t exist even though I definitely have a file with the exact filepath (I uploaded it myself). Do you have any insight to the problem there?

In the first image there’s a file with the path ‘storage/bears/black/urls_black.csv’, but the error says "No such file or directory: ‘storage/bears/black/urls_black.csv’ ".

If you just upload the images yourself, you should not run the csv file because it is for using the google url method. If certain code does not run, try to run the next code because that code may be for the way that is not for uploading image by yourself.

You can see my example here, but it is little bit complicated:

I’m not sure if you understand the issue I’m having. If I upload the images myself, they will still have a particular path in my Paperspace notebook.

Regardless of whether I’ve uploaded images or a csv file, the code still won’t work, because it’s not able to locate the file/directory location (so when I try to refer to the path of the images, I’ll get the same error that I’m currently getting).

Additionally, like I was saying, I still want to be able to use the google url method because it’s faster and easier; even if I wasn’t having the filepath issue through manual downloading/uploading of images, I still want to be able to do it with Google url.

Does anyone know how to get the notebook to locate the filepath of uploaded files?

Under “storage/bear” folder, you need to have three folders. They are black, grizzly, and teddys. Each three of these folders have 50 images and try not to use the code using CSV. If you still have problem, show us the image of the error message and show us the code.

One more thing, if you upload the images, do not run these following codes:
download_images(path/file, dest, max_pics=200)
download_images(path/file, dest, max_pics=20, max_workers=0)

I already have three folders under “storage/bear” called “black”, “grizzly”, and “teddys”.

I want to make sure I’m understanding your suggestion correctly: are you saying that I would have to download images manually from google images, and then upload them to the folders?

Yes. You need to make sure these three folders( three folders under “storage/bear” called “black”, “grizzly”, and “teddys”) have their bear images. If you are using local storage, you just put those image into their folder. If you are using colab , you need to upload them.

EDIT: I think I may have discovered the problem. I’ll test it shortly.

I figured out the error. I needed a “/” at the beginning of the filepath, so it should be “/storage/bears” instead of “storage/bears”. I had a feeling it was something silly like that, since I hadn’t changed the code at all and it worked in the lesson video.

I appreciate the help, @JonathanSum.