Can't find bird image -- code generates an image of an SUV


(Rob Forgione) #1

Hey all,

Hoping to get some guidance here. I downloaded the Imagenet dataset and modified the code in the Lesson 8 notebook to import my data. When I look for image 50 (which is the one used in the class notebook) I end up with this image:

truck

I haven’t been able to solve this or find any other forum topics dealing with it. I’m assuming that I’m missing something, but I also wanted to make triple-sure the .tar.gz file hasn’t changed (since I know the '18 version of the course is being released soon).Any suggestions are appreciated – thanks!


(Benedikt Brandt) #2

I am having the same issue


#3

Hi Not sure where you get the image 50 from but when done last the url of the image in the note book was

data/imagenet/sample/train/n01558993/n01558993_9684.JPEG

This is the image of the red/orange breasted bird. Note this was from the samples not the full training data but the file also resides there as well.

fnames = list(glob.iglob(path+'train/*/*.JPEG'))
n = len(fnames)
19439
fnames.index(path+'/train/n01558993/n01558993_9684.JPEG')
3268
img =Image.open(fnames[3268]); img

Perhaps I am not understanding your problem fully as you haven’t specified what you have actually changed and where .

With regards to 2018 version I expect that the directory structure will be different as before everything was under courses/deeplearning2 directory and it seems the early indication is that 2018 will be under fastai/courses/dl2 directory. I don’t see any reason to change the imagine data for 2018, but who knows

Cheers


(Rob Forgione) #4

Hey @RogerS49 – thanks for the reply. The issue arises when I run the notebook (from the 2017 course) exactly as-is. I basically just tried to run Jeremy’s code to make sure my machine was outputting the same that his was. When we got to this step, it was outputting the wrong image, which made it hard to compare the rest of the notebook.

@bbrandt – I ended up getting around this by specifically taking the filename of the bird image and filtering for it, rather than using the positional index from the notebook. As Roger said, it’s train/n01558993/n01558993_9684.jpeg. In case anyone else is running into this issue, this should be a decent workaround :slight_smile:


#5

Hi @rforgione

By any chance did the index into the bird image come back as 3268. I pulled the code fresh from repository and it indexes the image as 50 as you rightly say.

Can’t remember if we changed it last year from 50 to 3268.

Cheers