How to use Transfer Learning

Hi, I succeessfully trained my model using

train.py --config_path config.json

Now I have more data so I want to continue where I left and start training with the new data. Would it be right if I do

train.py --config_path config.json --restore_path /path/to/your/model.pth.tar
that.

Is that enough for continues learning or am I wrong.
Also when I tried to do the same with

CUDA_VISIBLE_DEVICES=“0,1,2,3” distribute.py --config_path config.json --restore_path /path/to/your/model.pth.tar

It failed. Can you suggest what might be wrong there.
Thanks.

@erogol can you help me out here?

you can use --continue_path by changing the config file of your pretrained model to include your new dataset. Or you can use --restore_path. So both would work fine.

I did, it worked fine with train.py but it gave error while using distribute.py. Any particular reasons?

without knowing the error there is no reason

I don’t have the logs right now but I’ll post again when I get the error.

What is the difference between these two?

–continue_path
–restore_path

CUDA_VISIBLE_DEVICES=“0,1,2,3” distribute.py --config_path config.json --restore_path /path/to/your/model.pth.tar

VS

CUDA_VISIBLE_DEVICES=“0,1,2,3” distribute.py --config_path config.json --continue_path /path/to/your/model.pth.tar`

Do they produce different results?

Use train.py -h for help

–continue_path will just continue your training with the same config in the same folder.

With --restore_path you can finetune a model with a different config, so --config_path is require with --restore_path. It will also create a new training folder.

2 Likes