TypeError: default_collate: batch must contain tensors, numpy arrays, numbers, dicts or lists; found <class ‘PIL.JpegImagePlugin.JpegImageFile’>

This roughly means that you are loading images but you are not converting them to pytorch tensors.
I would tell you to use torchvision reader or imageio. Makes no sense to use PIL if you are not doing any preprocess