Hi. Yep, mac makes this kind of files in their file system.
You have couple of options here:

Make sure there are no files like this in your folder. You can check in mac terminal with ls -la which will show files starting with dots and remove lets say files started with “._” manually. Don’t like this option, though.
You can make you ImageFolder dataset robust to erroneus data. According to documentation 2 you can use argument is_valid_file and provide with callable to evaluate the file validity. After that your dataset will ignore invalid files.

Minimal example:
import torchvision
from pathlib import Path

def check_valid(path):
    path = Path(path)
    return not path.stem.startswith('._')

ds = torchvision.datasets.ImageFolder('your_root_folder_here',  is_valid_file=check_valid)

Hope, it helps!