yolov7训练报错问题解决

训练时遇到:

Namespace(augment=False, batch_size=2, conf_thres=0.001, data='data/Aquarium_Combined_v3.yaml', device='', exist_ok=False, img_size=640, iou_thres=0.65, name='exp', no_trace=False, project='runs/test', save_conf=False, save_hybrid=False, save_json=False, save_txt=False, single_cls=False, task='val', v5_metric=False, verbose=False, weights='/home/yolov7-main/runs/train/yolov7+SIOU_Focal/weights/best.pt')

YOLOR 🚀 2022-10-8 torch 1.9.0+cu111 CUDA:0 (NVIDIA GeForce RTX 3080 Ti, 12053.8125MB)

fatal: not a git repository (or any of the parent directories): .git

Traceback (most recent call last):

File "/home/yolov7-main/utils/google_utils.py", line 26, 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 "test.py", line 320, in <module>

test(opt.data,

File "test.py", line 58, in test

model = attempt_load(weights, map_location=device) # load FP32 model

File "/home/yolov7-main/models/experimental.py", line 251, in attempt_load

attempt_download(w)

File "/home/yolov7-main/utils/google_utils.py", line 31, in attempt_download

tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]

File "/usr/lib/python3.8/subprocess.py", line 415, in check_output

return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,

File "/usr/lib/python3.8/subprocess.py", line 516, in run

raise CalledProcessError(retcode, process.args,

subprocess.CalledProcessError: Command 'git tag' returned non-zero exit status 128.

这是因为执行test.py的时候,pt文件路径中不能有大写字母,将大写字母去掉就可以了。

参考解决:yolov7在训练或测试时,出现fatal: not a git repository (or any...)及lndexError: list index out of range错误 - 知乎 (zhihu.com)

  • 5
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值