Skip to content

train_tensors in BaseDataset is mis-interpreted #356

Closed
@nabenabe0928

Description

@nabenabe0928

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    fix-laterIssues that have been close for a review later

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions