I wanted to plot images from data loader and it shows little different images.
## Specify appropriate transforms, and batch_sizes

normalizer = transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225))

transformed = transforms.Compose([

    transforms.Resize((224,224)),

    transforms.ColorJitter(),

    transforms.RandomHorizontalFlip(),

    transforms.RandomAffine(30),

    transforms.ToTensor(),

    normalizer,

])

transformed_test = transforms.Compose([

    transforms.Resize((299,299)),

    transforms.ToTensor(),

    normalizer,    

])

train_data = datasets.ImageFolder('/content/dogImages/train', transform=transformed)

test_data = datasets.ImageFolder('/content/dogImages/test', transform=transformed_test)

valid_data = datasets.ImageFolder('/content/dogImages/valid', transform=transformed)

train_loader = torch.utils.data.DataLoader(train_data,batch_size=batch_size,  shuffle=True, num_workers=0)

test_loader = torch.utils.data.DataLoader(test_data, batch_size=batch_size, num_workers=0)

valid_loader = torch.utils.data.DataLoader(valid_data, batch_size=batch_size, num_workers=0, shuffle=True)

## Visualizing

dataiter = iter(test_loader)

images, labels = dataiter.next()

images = images.numpy() 

#plot

fig = plt.figure(figsize=(25,4))

for idx in np.arange(10):

  ax = fig.add_subplot(2, 10/2, idx+1, xticks=[], yticks=[])

  plt.imshow(np.transpose(images[idx], (1,2,0)).astype('uint8'))

  ax.set_title(train_data.classes[idx])

when plotting when i dont use .astype('uint8') it show some message like this
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).

showing image like this

wird1336×251 148 KB

I hadnt used any color jitters to test images. Even multiplying by 255 didnt worked. Help!!