Lesson 1 - ImageDataBunch AttributeError: 'NoneType' object has no attribute 'group'

Hi, I’ve been trying to repeat Lesson 1 on my own set of images which I uploaded to Colab.

I keep getting the following error when running the line

data = ImageDataBunch.from_name_re(path_img, fnames, pat, ds_tfms=get_transforms(), size=224, bs=bs):

'AttributeError: ‘NoneType’ object has no attribute ‘group’`

My folder structure and file names are similar to the ones in the lesson, i.e. fnames[:5] returns


The regex seems to be correct, as I’m able to get the file name from a str() of an individual file path. It seems as if the ImageDataBunch method can’t process the fnames and I can’t figure out why because it’s exactly as in the Lesson.

I’ve been stuck with this for over a day now so I would really appreciate any help.


SOLVED: Looking at the images for the fourth time after a break, I noticed one of them wasn’t a .jpg, which was causing the issue…