Thanks for the update! I cannot reproduce the issue using your code and the training works fine:
model = CNN()
loaders = data_loaders()
    
# Train the model
criterion = nn.CrossEntropyLoss()

for i, (images, labels) in enumerate(loaders['train']):
    b_x = images   # batch x
    b_y = labels  # batch y
    print(np.shape(b_x), np.shape(b_y))
    output = model(b_x)[0]               
    loss = criterion(output, b_y)