Hello
I have an assignment due and I am positively freaking out, I have spent 5 hours trying to load 2 classes in from the FashionMNIST dataset, but I simply cannot figure it out.
I have tried
idx = torch.as_tensor(trainset.targets) == 1
idx += torch.as_tensor(trainset.targets) == 7
dset_train = torch.utils.data.dataset.Subset(trainset, np.where(idx==1)[0])

this
but is that alone enough?
I use it to then load a batch of 8 images from the trouser/sneaker classes, which ends up working, but THEN I try applying StandardScaler() or PCA, and it will not work.
It states that ‘only one element tensors can be converted to Python scalars’ and if I try using the subset in any code, it throws attribute errors e.g. AttributeError: ‘Subset’ object has no attribute ‘numpy’
I am trying to apply PCA to only 2 classes (trouser/sneaker) from the FashionMNIST dataset.
Help please.