Hello,
I created a data loader of the ucf101 video dataset
dataset = torchvision.datasets.UCF101('/content/drive/My Drive/Colab Notebooks/ucf101', annotation_path='/content/drive/My Drive/Colab Notebooks/ucfTrainTestlist', frames_per_clip=16, step_between_clips=1, frame_rate=None, fold=1, train=True, transform=transforms.Compose([transforms.ToTensor(),]))
data = torch.utils.data.DataLoader(dataset, batch_size=512, shuffle=True)
I want to see the shape and a full tensor of a random sample of this object, I tryed using
dataiter = iter(data)
for i in dataiter:
print(i)
print(i.shape())
but I get the error
TypeError Traceback (most recent call last)
<ipython-input-32-daa759a0394f> in <module>()
1 dataiter = iter(data)
----> 2 for i in dataiter:
3 print(i)
4 print(i.shape())
7 frames
/usr/local/lib/python3.6/dist-packages/torchvision/transforms/functional.py in to_tensor(pic)
40 """
41 if not(_is_pil_image(pic) or _is_numpy(pic)):
---> 42 raise TypeError('pic should be PIL Image or ndarray. Got {}'.format(type(pic)))
43
44 if _is_numpy(pic) and not _is_numpy_image(pic):
TypeError: pic should be PIL Image or ndarray. Got <class 'torch.Tensor'>