解决yolov7训练时报错:“subprocess.CalledProcessError: Command ‘git tag‘ returned non-zero exit status 128.”
用自己的数据集训练yolov7时报错如下,翻了网上很多教程没有找到解决办法,细想是因为源代码没有预先下载网络权重yolov7.pt等
Traceback (most recent call last):
File "D:\code\practice\yolov7\yolov7-main\utils\google_utils.py", line 27, in attempt_download
assets = [x['name'] for x in response['assets']] # release assets
KeyError: 'assets'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\code\practice\yolov7\yolov7-main\train.py", line 616, in <module>
train(hyp, opt, device, tb_writer)
File "D:\code\practice\yolov7\yolov7-main\train.py", line 86, in train
attempt_download(weights) # download if not found locally
File "D:\code\practice\yolov7\yolov7-main\utils\google_utils.py", line 32, in attempt_download
tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]
File "D:\setup\anaconda3\envs\yolo-v7-practice\lib\subprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "D:\setup\anaconda3\envs\yolo-v7-practice\lib\subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'git tag' returned non-zero exit status 128.
去官网下载权重
根据官网这条指令可知,权重应该放在根目录下面,注意路径不要出现错误,成功解决。