Is there any way to backup weights in YOLOv5 when training after a fixed number of iterations?

1k Views Asked by At

I want to backup weights while training YOLOv5 so that if the training stops for some reason i dont have to start all over again like in yolov3 you can mention the folder in which weights are backed up after every 100 iterations

1

There are 1 best solutions below

0
Chance Park On

In 'runs' folder, you can find weights file (*.pt) under the folder named your project.

For example,

enter image description here

Save the pt file, and load one when you detect something like this.

!python detect.py --weights '/content/drive/My Drive/yolov5/runs/exp8_i2_PA+pano_yolov5x_results/weights/best_i2_PA+pano_yolov5x_results.pt' --img 512 --conf 0.5 --source "{test_img_path}"