Closed
Description
The continuation of issue#352.
if I understand the code correctly, we are assuming that train_tensors[0]
is always feature tensors and train_tensors[1]
is always labels.
However, Dataset
in torch
assumes the following structure:
In [1]: import torchvision.datasets
In [2]: train_tensors = torchvision.datasets.CIFAR10('cifar10/')
In [3]: train_tensors[0]
Out[3]: (<PIL.Image.Image image mode=RGB size=32x32 at 0x7F8B6DAD3370>, 6)
In [4]: train_tensors[1]
Out[4]: (<PIL.Image.Image image mode=RGB size=32x32 at 0x7F8B6DAD33A0>, 9)
It indicates that the __getitem__
of Dataset
(actually it applies to other Dataset
child classes as well) returns:
train_tensors[i] := the i-th instance in the given dataset
It does not matter unless we use torch stuff, but those stuffs will cause many issues when we try to merge image tasks