'PosixPath' is not iterable on Kaggle's MNIST Competition

HI everyone,
I am trying to implement Lesson1’s ideas on the Kaggle Digit Recognizer Competition. I have gotten to the point of getting the data ready to be fed into an ImageDataBunch object using from_folder. However, I keep getting this error that I am not sure what is going on?

TypeError: argument of type 'PosixPath' is not iterable

Here is the link to my Notebook. If anyone could help, it would be greatly appreciated?
https://www.kaggle.com/sanwal092/fastai-and-mnist

Hi,

In the documentation I see you’re supposed to specify with path the folder that contains both the train and test folders.

from_folder ( path : PathOrStr , train : PathOrStr = 'train' …)

Your path points to the train folder it seems to me.

1 Like

@sinsji So I have been working on this since yesterday and I think I figured out why. It seems the PosixPath wasn’t been iterated by ImageDataBunch. I changed the path created by pathlib library which was an PosixPath object to just a string which specified the path to the training and testing directories and it worked. I will run the final kernel tomorrow and will share the result here!!

1 Like

I was facing this same issue from yesterday, It worked like a charm when I converted it into string! Thanks sir.