Solved by jhjungCode in post #2 
              
              
                The type of data from  dataloader seem to be float64, so, you can change this float32 like below 
# if img is numpy
img = img.astype('float32')
# if img is torch.tensor
img = img.float()