Thanks a lot for your response. I removed the ToTensor ones from the transformations, and get same error:

train_transforms = transforms.Compose(
    [
        transforms.Resize((256, 512)),
        transforms.RandomResizedCrop(256),
        transforms.RandomHorizontalFlip(),
        #transforms.ToTensor(),
    ]
)

val_transforms = transforms.Compose(
    [
        transforms.Resize((256, 512)),
        transforms.CenterCrop(256),
        #transforms.ToTensor(),
    ]
)

 transformed_features = self.transform(features)
  File "/SeaExp/mona/venv/dpcc/lib/python3.8/site-packages/torchvision/transforms/transforms.py", line 60, in __call__
    img = t(img)
  File "/SeaExp/mona/venv/dpcc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/SeaExp/mona/venv/dpcc/lib/python3.8/site-packages/torchvision/transforms/transforms.py", line 297, in forward
    return F.resize(img, self.size, self.interpolation, self.max_size, self.antialias)
  File "/SeaExp/mona/venv/dpcc/lib/python3.8/site-packages/torchvision/transforms/functional.py", line 403, in resize
    return F_t.resize(img, size=size, interpolation=interpolation.value, max_size=max_size, antialias=antialias)
  File "/SeaExp/mona/venv/dpcc/lib/python3.8/site-packages/torchvision/transforms/functional_tensor.py", line 552, in resize
    img = interpolate(img, size=[new_h, new_w], mode=interpolation, align_corners=align_corners)
  File "/SeaExp/mona/venv/dpcc/lib/python3.8/site-packages/torch/nn/functional.py", line 3630, in interpolate
    raise ValueError(
ValueError: size shape must match input shape. Input is 1D, size is 2

torch.Size([2957, 512])

This is despite the fact that features is a 2D input:
features size:  torch.Size([1813, 512])
here:
print("features size: ", features.shape)
transformed_features = self.transform(features)