mchowdhu:

torch.from_numpy(pic.transpose((2, 0, 1))) ValueError: axes don’t match array


AttributeError seems comes from sample['grade']whenever i call '‘print(sample[‘grade’])’ it gives output*
(64, 64)
2.0
I am not quit sure what do you mean by print __getitem__? Now i called the ‘print’ function  like this print(sample['image']) print(sample['grade'])
And got the result like thisprint(sample['image']) print(sample['grade']) [[175 177 176 ... 81 79 68] [175 175 174 ... 79 82 79] [173 172 173 ... 76 75 78] ... [122 120 121 ... 45 45 46] [121 121 120 ... 45 45 44] [122 122 123 ... 44 44 43]] 2