I am trying to make a video dataloader in the https://github.com/pytorch/tutorials/issues/78 116 approach but I am getting this error
Traceback (most recent call last):
File “dataload.py 4”, line 59, in 
for batch_idx, (data,target) in enumerate(train_loader):
File “/home/acp15maj/.conda/envs/pytorch/lib/python3.5/site-packages/torch/utils/data/dataloader.py”, line 201, in next
return self._process_next_batch(batch)
File “/home/acp15maj/.conda/envs/pytorch/lib/python3.5/site-packages/torch/utils/data/dataloader.py”, line 221, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
RuntimeError: Traceback (most recent call last):
File “/home/acp15maj/.conda/envs/pytorch/lib/python3.5/site-packages/torch/utils/data/dataloader.py”, line 40, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File “/home/acp15maj/.conda/envs/pytorch/lib/python3.5/site-packages/torch/utils/data/dataloader.py”, line 109, in default_collate
return [default_collate(samples) for samples in transposed]
File “/home/acp15maj/.conda/envs/pytorch/lib/python3.5/site-packages/torch/utils/data/dataloader.py”, line 109, in 
return [default_collate(samples) for samples in transposed]
File “/home/acp15maj/.conda/envs/pytorch/lib/python3.5/site-packages/torch/utils/data/dataloader.py”, line 95, in default_collate
return torch.stack([torch.from_numpy(b) for b in batch], 0)
File “/home/acp15maj/.conda/envs/pytorch/lib/python3.5/site-packages/torch/functional.py”, line 64, in stack
return torch.cat(inputs, dim)
RuntimeError: inconsistent tensor sizes at /opt/conda/conda-bld/pytorch_1503968623488/work/torch/lib/TH/generic/THTensorMath.c:2709
My code is
class CustomDataset(Dataset):
    def __init__(self,csv_path,transform=None):
        # TODO
        # 1. Initialize file path or list of file names.
        # full file path is given in the .csv file
        temp_df = pd.read_csv(csv_path)
        self.label=MultiLabelBinarizer()
        self.transform=transform
        self.X_train=temp_df['video_file']
        self.Y_train=self.label.fit_transform(temp_df['label'].to_string().split()).astype(np.float32)

    def __getitem__(self, index):
        # numpy array of video file (50,3,200,112) shape
        video_file=cvstream.get_video(self.X_train[index]) 
        video_tensor=torch.from_numpy(video_file)
        if self.transform is not None:
            video_file=self.transform(video_file)
        target_labels=torch.from_numpy(self.Y_train[index])
        print(target_labels)
        return video_tensor,target_labels

    def __len__(self):
        return len(self.X_train.index)



if __name__ == '__main__':
    # Then, you can just use prebuilt torch's data loader.
    custom_dataset = CustomDataset('trainlist01.csv',transform=None)
    train_loader = torch.utils.data.DataLoader(dataset=custom_dataset,
                                               batch_size=3,
                                               shuffle=True,
                                               num_workers=3
                                                )
    for batch_idx, (data,target) in enumerate(train_loader):
        data, target = data.cuda(async=True), target.cuda(async=True)

Please pardon me if it is a silly question.