Hello all,
I’m new to roboflow and was trying out ViT project from How to Train the Hugging Face Vision Transformer On a Custom Dataset, but faced some simple errors that I’m not sure how to get rid of. Can anyone help to solve this Errno2?
Also, the next part has a directory issue which also not sure how to edit.
import torchvision
from torchvision.transforms import ToTensor
train_ds = torchvision.datasets.ImageFolder(‘/content/train/’, transform=ToTensor())
valid_ds = torchvision.datasets.ImageFolder(‘/content/valid/’, transform=ToTensor())
test_ds = torchvision.datasets.ImageFolder(‘/content/test/’, transform=ToTensor())
FileNotFoundError Traceback (most recent call last)
in
2 from torchvision.transforms import ToTensor
3
----> 4 train_ds = torchvision.datasets.ImageFolder(‘/content/train/’, transform=ToTensor())
5 valid_ds = torchvision.datasets.ImageFolder(‘/content/valid/’, transform=ToTensor())
6 test_ds = torchvision.datasets.ImageFolder(‘/content/test/’, transform=ToTensor())
3 frames
/usr/local/lib/python3.8/dist-packages/torchvision/datasets/folder.py in find_classes(directory)
38 See :class:DatasetFolder
for details.
39 “”"
—> 40 classes = sorted(entry.name for entry in os.scandir(directory) if entry.is_dir())
41 if not classes:
42 raise FileNotFoundError(f"Couldn’t find any class folder in {directory}.")
FileNotFoundError: [Errno 2] No such file or directory: ‘/content/train/’
Thank you,