I am working on a machine-learning classification model. It works fine on greyscale data set. But the performance on RGB images is poor. So, I decided to apply torch.pca_lowrank
on the RGB data set to see if this can improve the feature representations and the model’s performance.
Here is my code sample:
U, S, V = torch.pca_lowrank(torch.as_tensor(train_dataset) , q=None, center=True, niter=3)
train_dataset = torch.matmul(train_dataset, V[:, :n_components])
I am getting this error:
ValueError: only one element tensors can be converted to Python scalars
Any suggestions, please? Thanks.