Hi, after you’re converting from numpy to tensor, make sure you have an additional channel dimension (channel first), as of this transformation requires it if it is working with tensors. You can do it with: x = x.unsqueeze(0), this adds channel dimension to be the first one.
From docs. 2

The image can be a PIL Image or a Tensor, in which case it is expected to have […, 3, H, W] shape, where … means an arbitrary number of leading dimensions