Skip to content

Latest commit

 

History

History
34 lines (31 loc) · 1.73 KB

Scaffold.md

File metadata and controls

34 lines (31 loc) · 1.73 KB

If you want to train model

1. Prepare your dataset

For example, you can put image dataset in a folder. I put it here: E:/Oxford_Flowers17/train

Here are some datasets available:
Baidu Yun Google
flowers17(kkdc) flowers17
SceneClass13(0onp) SceneClass13
AnimTransDistr(otd5) AnimTransDistr

ps: Of course you can define dataloader on your own!

2. Train within 3 lines

You can train from zero

from classifier import classifier
if __name__ == '__main__': # removing this line brings dataloader error, this is because of python's multithread feature
    clf = classifier('xception', 17, (200, 200), 'E:/Oxford_Flowers17/train')
    clf.train()

It will begin to train a Xception with dataloader with 17 classes, resize image to 200*200, load data from 'E:/Oxford_Flowers17/train'. Best model will be saved to folder "./saved"every 2 epoch. To know more about default setting, click here.

Or resume previous training

from classifier import classifier
if __name__ == '__main__':
    clf = classifier('xception', 17, (60, 60), 'E:/Oxford_Flowers17/train')
    clf.train_from('E:/ModelFeast/saved/xception/0305_130143/checkpoint_best.pth')

unbelievably simple, right ?!