Thanks for the reply!
I’m using

loss = criterion(outputs, lab1)

not (outputs, labels). Sorry for the typo.
outputs = torch.Size([16,136])
lab1 = torch.Size([16])
epoch_loss = 43449.26647949219
epoch_acc.shape = torch.Size([])
train Loss: 3.4776 Acc: 0.1683
epoch_loss = 30073.398727416992
epoch_acc.shape = torch.Size([])
val Loss: 3.3855 Acc: 0.1740
I’m using the following function for dataloading:
def image_generator(file, label_file, batch_size = 16):
    new_bs=0
    size = len(file)
    for i in range(math.floor(size/batch_size)):
        batch_x = file[new_bs:(new_bs+batch_size)]
        batch_y = label_file[new_bs:(new_bs+batch_size)]
        new_bs += batch_size
        yield(batch_x, batch_y)

dataloaders = {'train': image_generator(X_train, y_train, batch_size = 16), 
                 'val': image_generator(X_val, y_val, batch_size = 16)
                }

Here in image_generator function, X_train is a tensor and y_train is a NumPy array.
If there’s any other better method for dataloading please suggest, as I have all the images in single folder and I can’t use ImageFolder.