Hi ptrblck thanks for quick reply!
Here is my dataset implementation. In this, you can see that I attempt to change the data[‘train’] /valid/test calsses to the correct values.
# Load the Data

# Set train and valid directory paths
train_directory = 'datasets/train'
valid_directory = 'datasets/valid'
test_directory = 'datasets/test'
 
# Batch size
bs = 4
 
# Number of classes
num_classes = 8
 
# Load Data from folders
data = {
    'train': datasets.ImageFolder(root=train_directory, transform=image_transforms['train']),
    'valid': datasets.ImageFolder(root=valid_directory, transform=image_transforms['valid']),
    'test': datasets.ImageFolder(root=test_directory, transform=image_transforms['test'])
}
 
# Size of Data, to be used for calculating Average Loss and Accuracy
train_data_size = len(data['train'])
valid_data_size = len(data['valid'])
test_data_size = len(data['test'])

# I have tried both .classes and .labels same result
data['train'].classes = train_dic
data['valid'].classes = valid_dic
data['test'].classes = test_dic
 
# Create iterators for the Data loaded using DataLoader module
train_data = torch.utils.data.DataLoader(data['train'], batch_size=bs, shuffle=True)
valid_data = torch.utils.data.DataLoader(data['valid'], batch_size=bs, shuffle=True)
test_data = torch.utils.data.DataLoader(data['test'], batch_size=bs, shuffle=True)
 
# Print the train, validation and test set data sizes
train_data_size, valid_data_size, test_data_size


Let me note that train_dic, valid_dic, and test_dic are lists of integers 0-7 according the specific classes. When I try to run the following code snippet of the training
epochs = 3
device = torch.device("cuda:0")
# Define Optimizer and Loss Function
loss_func = nn.NLLLoss()
optimizer = torch.optim.Adam(res50.parameters())

for j, (inputs, labels) in enumerate(train_data):
        inputs = inputs.to(device)
        labels = labels.to(device)
        print(inputs)
        print(labels)

The results for the inputs refer to the image tensors and labels I expect to be the number 0-7 as mentioned but they are all 1.
INPUT:
tensor([[[[-2.1179, -2.1179, -2.1179,  ..., -2.1179, -2.1179, -2.1179],
          [-2.1179, -2.1179, -2.1179,  ..., -2.1179, -2.1179, -2.1179],
          [-2.1179, -2.1179, -2.1179,  ..., -2.1179, -2.1179, -2.1179],
          ...,
          [-2.1179, -2.1179, -2.1179,  ..., -2.1179, -2.1179, -2.1179],
          [-2.1179, -2.1179, -2.1179,  ..., -2.1179, -2.1179, -2.1179],
          [-2.1179, -2.1179, -2.1179,  ..., -2.1179, -2.1179, -2.1179]],
...
LABELS:
tensor([1, 1, 1, 1], device='cuda:0')