Hi Everyone , when i pass the ‘pat’ parameter in the ImageDataBunch.from_name_re function i get this Error :
Failed to find “re.compile(’([^\\]+)_\d+.jpg$’)” in “/content/drive/My Drive/911_Class/1. image-full-width-s0.jpg”
any suggestions ? , thank U .
Hey mididou, You need of correct matching characters,
in your case:
pat = r’([\w\s.-]).jpg’
maybe works, but for more information read
Regular Expression HOWTO
Sir , i can not thank u enough for U help , it worked perfeclty.
knowing that i had to tweak the ‘PAT’ argument a bit , i used this one ,
pat = r’([\w\s.-]).[jpg]’
1000 thanks .
I also have the same problem
I have been trying to extract “apples” and “tomatoes” with pat = r"/([^/]+)\d+.jpg$", but this doest seem to work. When I run the line data = ImageDataBunch.from_name_re(path_img, fnamess, pat,
size=224, bs=bs )
I get the error : "Failed to find "re.compile(’/([^/]+)\d+.jpg$’)" in “/content/data/apples_30.jpeg”
Can somebody please help me out to find RE that works for .jpg and .png as well.