Closed hongjianyuan closed 3 years ago
Hi @hongjianyuan,
In order to train with your custom data, you need to make the following changes on the code:
dataset_name
case here https://github.com/valeoai/obow/blob/main/obow/datasets.py#L266 for your custom data. E.g.:
if dataset_name == "ImageNet":
dataset_train, dataset_test = get_ImageNet_data_for_obow(data_dir, **kwargs)
elif dataset_name == "MyCustomData":
dataset_train, dataset_test = get_MyCustom_data_for_obow(data_dir, **kwargs)
else:
raise NotImplementedError(f"Not supported dataset {dataset_name}")
get_MyCustom_data_for_obow()
function inside dataset.py
that should be exactly like the existing get_ImageNet_data_for_obow()
function with the only difference being that this point https://github.com/valeoai/obow/blob/main/obow/datasets.py#L238 you should load your own custom data.config/ImageNetFull/ResNet50_OBoW_full.yaml
(https://github.com/valeoai/obow/blob/main/config/ImageNetFull/ResNet50_OBoW_full.yaml) but:
3.a Leave the num_classes
field empty here https://github.com/valeoai/obow/blob/main/config/ImageNetFull/ResNet50_OBoW_full.yaml#L18
3.b Specify in the dataset_name
field your custom data https://github.com/valeoai/obow/blob/main/config/ImageNetFull/ResNet50_OBoW_full.yaml#L35
How to use custom data?What needs to be modified? Thanks