I have calculated the mean and std for normalization using following code
mean = 0.
std = 0.
nb_samples = 0.
for data,_ in train_loader:
batch_samples = data.size(0)
data = data.view(batch_samples, data.size(1), -1)
mean += data.mean(2).sum(0)
std += data.std(2).sum(0)
nb_samples += batch_samples
mean /= nb_samples
std /= nb_samples
I got these values
[0.5820, 0.4512, 0.4023], [0.2217, 0.1858, 0.1705]
when I put the values, it gives me this warning
Clipping input data to the valid range for imshow with RGB data ([0…1] for floats or [0…255] for integers).
But if I used the values calculated for imagenet dataset subset, it does not give warning.
So which values should I use?