Ah, sorry about that.
transform = transforms.Compose([
            transforms.ToPILImage(),
            transforms.Resize((240,320)),
            transforms.ToTensor(),
            transforms.Normalize(MEAN, STD)
        ])

for video in videos:
   frames = [transform(frame) for frame in video]
   frames = torch.stack(frames)
   frames = frames.cuda()
   feature = feature_extractor(frames)
   features.append(feature)

I am trying to perform action recognition using CNN, and this the above is part of the Dataset class I am trying to write. Frames are images at a certain point in the video. I am not too sure what the dimensions mean to be honest… But I’m using Resnet-50 as the feature extractor, so that explains the 2048.
Other things I’ve tried:

converting the frames to RGB using PIL.Image (shouldn’t be required since the training videos are already in colour)
setting batch_size = 1

Both didn’t work…
As for DataParallel and DDP, I’m not too sure what those two are. I just write a Dataset class, get the data using a dataloader and iterate over it.