Hi,
Here is the problem. MNIST object does not have transform and target_transform. You need to call dataset attribute of MNIST then call transform etc.



 patrick126:

dataset_valid.transform = transform
dataset_valid.target_transform = OneHot()



Solution:
dataset_valid.dataset.transform = transform
dataset_valid.dataset.target_transform = OneHot()

Bests