Hi all,
I am trying to load a bunch of .pt files from separate folders with the folder names as labels, .the pt files are tensors with size [height, weight, channel].
I assume something could work in a similar way as the ImageFolder or DataFolder. But when I tried the following script, it throws me some error:
data_dir = './data' # the folder has multiple subfolders which contain the pt files
data_loader = torch.utils.data.TensorDataset(
datasets.DataFolder(data_dir, transforms.Compose([
transforms.Normalize(mean=mean,std=std),
])),
batch_size = 1, orkers = 0,
)
Then I got the following error:
AttributeError: module 'torchvision.datasets' has no attribute 'DataFolder'
I am just wondering how could this be correctly done in the DataFolder manner. The dataloader I am trying to create here will be used for evaluation only, not for training. I am new to PyTorch and any help is greatly appreciated. Thank you!