#   to the ImageFolder structure
data_dir = "./plane"

# Models to choose from [resnet, alexnet, vgg, squeezenet, densenet, inception]
model_name = "resnet"

# Number of classes in the dataset
num_classes = 71

# Batch size for training (change depending on how much memory you have)
batch_size = 10

# Number of epochs to train for 
num_epochs = 3

# Flag for feature extracting. When False, we finetune the whole model, 
#   when True we only update the reshaped layer params
feature_extract = True

# Detect if we have a GPU available
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
# device = "cpu"

What i mean is the number of class in this code, if I put 70, or 69, it gives me that error, but if I put 71 there, it works somehow, but I’m not sure the model is classifying correctly because the accuracy is low.
On the other hand, I have no idea how can I tell that my target contain indices between 0 and 69?