chufengt/ALM-pedestrian-attribute

no dataset loading interface

Closed this issue · 2 comments

eeric commented

in main.py:
the line 56:
train_dataset, val_dataset, attr_num, description = Get_Dataset(args.experiment, args.approach)
go to the line 194 in utils/datasets.py:
elif experiment == 'peta':
train_dataset = MultiLabelDataset(root='data_path', label='train_list_path', transform=transform_train) val_dataset = MultiLabelDataset(root='data_path', label='val_list_path', transform=transform_test)
return train_dataset, val_dataset, attr_nums['peta'], description['peta']

no define about root and label.

eeric commented

modified as following:
the line 56 in main.py:
# dataset path
dataset_list={'data_path': '/path to your peta dataset', 'train_list_path': '/path to your label/data_list/peta/PETA_train_list.txt', 'val_list_path': '/path to your label/data_list/peta/PETA_test_list.txt'}
# Data loading code
train_dataset, val_dataset, attr_num, description = Get_Dataset(args.experiment, dataset_list)

the line 194 in utils/datasets.py:
elif experiment == 'peta':
train_dataset = MultiLabelDataset(root=data_list['data_path'],
label=data_list['train_list_path'], transform=transform_train)
val_dataset = MultiLabelDataset(root=data_list['data_path'],
label=data_list['val_list_path'], transform=transform_test)
return train_dataset, val_dataset, attr_nums['peta'], description['peta']

so, it will work well.

Thanks for your advice.