pytorch-YOLOv4 icon indicating copy to clipboard operation
pytorch-YOLOv4 copied to clipboard

How to continue train according to the last weights(.pth) file?

Open yinhai86924 opened this issue 5 years ago • 2 comments

I trained 100 epochs and get the .pth file, but I want to know how to continue training according the .pth file. Thank you for your help

yinhai86924 avatar Mar 17 '21 05:03 yinhai86924

did you find any way to continue training according to the last weight file

batuhanbeytekin avatar Jul 30 '21 12:07 batuhanbeytekin

아래 링크 속 line 76 부터 이미 구현된 코드를 참고하여 해결하였습니다.

https://github.com/WongKinYiu/PyTorch_YOLOv4/blob/master/train.py

models.py에서 Yolov4 클래스의 이미 작성된 기능에 오버라이딩 하였으나 동작하지 않아 train.py에서 초기 모델 로딩 후 가중치를 로드하도록 수정하였습니다.

정상적으로 작동합니다!🎉


I tried writing in English, Sorry! 😂

It was solved by referring to the code already implemented from line 76 in the link below.

https://github.com/WongKinYiu/PyTorch_YOLOv4/blob/master/train.py

In models.py, I overridden the already written function of the Yolov4 class, but it did not work, so I modified it to load the weights after loading the initial model in train.py.

Works fine!🎉

cjsal95 avatar Feb 09 '22 10:02 cjsal95