Thank you! By the way, I found that if I do not intend to normalize the data by calling dat_dataset2 = DatDataSet(root_dir=data_dir) , i.e. let transform=None. It will say:
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-100-7fb86a0566ae> in <module>
----> 1 tempp=dat_dataset2[1];

<ipython-input-91-584bf0a783d6> in __getitem__(self, idx)
     18         img=img.values;
     19         img_pil = Image.fromarray(img)
---> 20         img = self.transform(img_pil)
     21         sample={'data':img,'label':int(self.labellist[idx])}
     22         return sample

TypeError: 'NoneType' object is not callable

So can I impletement ‘no normalization’ by not calling transform=transform?