ImageFolder will create the class indices starting at 0, so I guess ./data_project/training contains at least 4 folders. You could print the train_dataset.classes and train_dataset.class_to_index for further debugging.