fasterrcnn-pytorch-training-pipeline icon indicating copy to clipboard operation
fasterrcnn-pytorch-training-pipeline copied to clipboard

how to retrain model

Open Arunxavierpro opened this issue 2 years ago • 9 comments

give me reply

Arunxavierpro avatar Dec 21 '22 07:12 Arunxavierpro

@Arunxavierpro You can pass the desired weight path using --weights flag. e.g. python train.py --weights weights.pth <rest of the command> You can also pass --resume-training (boolean flag) if you want to continue with the desired weight's optimizer state dictionary. python train.py --weights weights.pth --resume-training <rest of the command>

sovit-123 avatar Dec 21 '22 07:12 sovit-123

Please close the issue from your side if this solves your query.

sovit-123 avatar Dec 21 '22 07:12 sovit-123

@Arunxavierpro You can pass the desired weight path using --weights flag. e.g. python train.py --weights weights.pth <rest of the command> You can also pass --resume-training (boolean flag) if you want to continue with the desired weight's optimizer state dictionary. python train.py --weights weights.pth --resume-training <rest of the command>

rest command list out

Arunxavierpro avatar Dec 21 '22 08:12 Arunxavierpro

It depends on your commands also. But in general, it should be:

python train.py --config data_configs/smoke.yaml --epochs 100 --model fasterrcnn_resnet50_fpn --project-name smoke_training --batch-size 16

sovit-123 avatar Dec 21 '22 10:12 sovit-123

@sovit-123 this output only showing and not retrain Loading optimizer state dictionary... wandb: Waiting for W&B process to finish... (success). wandb: You can sync this run to the cloud by running: wandb: wandb sync /content/fastercnn-pytorch-training-pipeline/wandb/offline-run-20221221_103521-1d3l1e1l wandb: Find logs at: ./wandb/offline-run-20221221_103521-1d3l1e1l/l

Arunxavierpro avatar Dec 21 '22 10:12 Arunxavierpro

@Arunxavierpro With the above command you need to pass the weights file. python train.py --config data_configs/smoke.yaml --epochs 100 --model fasterrcnn_resnet50_fpn --project-name smoke_training --batch-size 16 --weights weights.pth --resume-training

sovit-123 avatar Dec 21 '22 11:12 sovit-123

i loaded weights.pth file correctly bro

Arunxavierpro avatar Dec 21 '22 11:12 Arunxavierpro

@sovit-123 https://colab.research.google.com/drive/1XqxKuZgQpNQhlzAcquUK80xcX7Pv77e2?usp=sharing see the notebbok

Arunxavierpro avatar Dec 21 '22 11:12 Arunxavierpro

@Arunxavierpro My bad. I forgot to mention. When you pass --resume-training, you need to provide more number of epochs than the previous training. It will resume from the previous training. If you train for 10 epochs the first time, and pass 20 epochs with --resume-training, it will train for 10 more epochs.

sovit-123 avatar Dec 21 '22 11:12 sovit-123