I can not thank you enough @ptrblck
I will make all these changes and let you know.
=========================
Update
Hi @ptrblck ,
This is how I modified the code
target_transform = Compose([
    CenterCrop(256),
    #Resize(136),
    ToLabel(),
    Relabel(255, 1),
])

and I added a print statement here to print labels :

for epoch in range(1, num_epochs+1):
    epoch_loss = []
    iteration=1
    for step, (images, labels) in enumerate(trainLoader):
        print("Iter:"+str(iteration))
        print("Labels ==> ",np.unique(np.array(labels)))
        iteration=iteration+1
        inputs = Variable(images)
        targets = Variable(labels)
        
        outputs = model(inputs)
        optimizer.zero_grad()
        print("outputs size ==> ",outputs.size())
        
        print("outputs[:,0] size ==> ",outputs[:,0].size())
        print("targets[:, 0] size ==> ",targets[:, 0].size())


        #loss = criterion(outputs, targets[:, 0])
        
        #print(targets[:,0])
        loss = criterion(outputs,targets[:,0])
        
        loss.backward()
        optimizer.step()
        epoch_loss.append(loss.data[0])
        
        average = sum(epoch_loss) / len(epoch_loss)
        
        print("loss: "+str(average)+" epoch: "+str(epoch)+", step: "+str(step))

And this is the output I am getting ,
Iter:1
Labels ==>  [ 0 40]
x torch.Size([1, 3, 256, 256])
conv1 torch.Size([1, 64, 256, 256])
layer1 torch.Size([1, 256, 256, 256])
layer2 torch.Size([1, 512, 256, 256])
layer3 torch.Size([1, 1024, 256, 256])

Could you please help ?