Train on custom dataset
Closed this issue · 6 comments
Today I tried to use this implementation on custom dataset, as you said in readme file
for training on custom dataset we have to add path to training dataset by -r
flag , but in the train.py there is no such flag? So could you please help me about how to train efficientnet-b0
on custom dataset?
It seems that I forgot to update README.md
file. Please change the path to the training dataset in the config file.
Thanks , did you mean to add new CustomDataLoader or we can just set path of training data?
If the directory structure of your dataset is the same as the ImageNet, then you can just set path of training data. Otherwise, you should add a new custom data loader.
@narumiruna ,Thanks I add my dataset to the data folder and training is started, but did you get good performance on custom dataset? I have a dataset of two class with images with size 44, but my accuracy don't increase from 78%.
Maybe you can disable the augmentation by replacing
efficientnet-pytorch/efficientnet/datasets/imagenet.py
Lines 37 to 50 in 42e95f5
with
transform = transforms.Compose([
transforms.Resize(image_size + 32, interpolation=Image.BICUBIC),
transforms.CenterCrop(image_size),
transforms.ToTensor(),
normalize,
])
or use less augmentation.
Thanks, I will test it