torch_fresh:

transform = transforms.Compose([
        transforms.ToTensor(),
        transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
    ])



The ToTensor tfm is expecting a channel last image, this works:
transform(np.random.random((224,244, 3)))

it is also not expecting a batch. From the dos:

Convert a PIL Image or numpy.ndarray to tensor.

It expects one PIL image.