在用YOLOV4-WongKinYiu时训练时,不小心训练中断了,在恢复训练时遇到这个问题
Traceback (most recent call last):
File "train.py", line 538, in <module>
train(hyp, opt, device, tb_writer, wandb)
File "train.py", line 81, in train
model = Darknet(opt.cfg).to(device) # create
File "/root/autodl-tmp/yolov4-wky/models/models.py", line 451, in __init__
self.module_defs = parse_model_cfg(cfg)
File "/root/autodl-tmp/yolov4-wky/utils/parse_config.py", line 13, in parse_model_cfg
with open(path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '.cfg'
解决方案:
在train.py的第537行之前加入该行代码
opt.cfg, opt.weights, opt.resume = './cfg/crowd.cfg',ckpt, True # 中断恢复训练
修改后的