YOLOv6
YOLOv6 copied to clipboard
Resume command Doesn't Work
I have even tried several solutions suggested earlier but that doesn't help, Error is as below.....
Traceback (most recent call last):
File "tools/train.py", line 114, in
TypeError: 'NoneType' object is not subscriptable
**
Thanks for your attentions! What is your resume command?
Thanks for your attention! What is your resume command?
!python tools/train.py --resume runs/train/exp2/weights/best_ckpt.pt
Are you resuming from the last checkpoint? Since last checkpoint does not contain optimizer parameters, we cannot resume from the last checkpoint. If you want finetuning, you can add the model path here https://github.com/meituan/YOLOv6/blob/5f00d8bf374d9f2cd01cc8ab9a4204ce37d66186/configs/yolov6s.py#L4
Are you resuming from the last checkpoint? Since last checkpoint does not contain optimizer parameters, we cannot resume from the last checkpoint. If you want finetuning, you can add the model path here
https://github.com/meituan/YOLOv6/blob/5f00d8bf374d9f2cd01cc8ab9a4204ce37d66186/configs/yolov6s.py#L4
If we cant resume from the last ckpt then it means we have to retrain & past learning is completely lost? So isn't it like we can't resume?
This. It should be fixed
This. It should be fixed
But Exactly How, I have tried several ways to do that, If we modify weights in finetune.py with best ckpt of our training results then further training goes vegue. So it's like not able to resume in true sense. Error that blows is about not finding optimizer in ckpts generated by the model, if that would be resolved then probably we could resume training.
strip_optimizer()函数有问题 : for k in ['optimizer', 'ema', 'updates']: # keys ckpt[k] = None 注释一下 问题解决。
This method worked for me In yolov6s_finetune.py you should edit pretrained = '/path/to/the/last_ckpt.pt' example pretrained='./runs/train/exp/weights/last_ckpt.pt', then run command
!python tools/train.py --conf configs/yolov6s_finetune.py #--params_u_need_put here it will create new folder (./runs/train/exp1) and every time you want to train, should replace new last_ckpt.pt path in yolov6s_finetune.py example pretrained='./runs/train/exp1/weights/last_ckpt.pt', pretrained='./runs/train/exp2/weights/last_ckpt.pt', pretrained='./runs/train/exp3/weights/last_ckpt.pt' and so on Hope it will help u
@ken2190 , fixed it replacing pretrained='weights/yolov6s.pt'
by pretrained='./runs/train/exp/weights/last_ckpt.pt'`, Thanks!