I encountered this error when I was trying to following the methods in FAQs to turn the video into tensor for faster processing.
Here are my codes. May I know what I have done wrong?
    container = av.open(filepath)
    stream = container.streams.video[0]
    tensor = []
    for frame in container.decode(stream):
        frame_data = torch.from_numpy(frame.to_ndarray(format="rgb24"))
        frame_data = swapaxes(swapaxes(frame_data, 0, -1), 1, 2)
        tensor.append(frame_data)
    container.close()
    tensor_video = torch.stack(tensor, dim=0)
    
    # export pose as csv
    video_prediction = detector.detect_video(tensor_video, skip_frames = 24, data_type='tensor')