from ultralytics import YOLO
import multiprocessing
def main():
# Load a model
model = YOLO("runs/train/exp/weights/last.pt")
# Resume training
results = model.train(resume=True)
print(results)
if __name__ == '__main__':
multiprocessing.freeze_support()
main()
在跑训练时不小心按到了CTRL+C,后面去官方代码查了一下恢复方法。
官方代码上面给的示例需要改动一下,不然恢复不了。