Skip to content

Tag: pytorch

TypeError: img should be PIL Image. Got – PyTorch

I’m trying to prepare some image data for my neural to classify. As part of the image preprocessing step, I’m applying the HOG filter in my dataset class as such: After this, I define my train and validation transformation as such: and finally, I create the loaders as such: However, when I attempt…

PyTorch – AssertionError: Size mismatch between tensors

I am trying to adapt a Pytorch script that was created for linear regression. It was originally written to take in a set of random values(created with np.random) as features and targets. I have now created a dataframe of actual data for analysis: The df looks like this: …and I am currently extracting ju…