当前位置:   article > 正文

yolov7运行test.py文件出现subprocess.CalledProcessError: Command ‘git tag‘ returned non-zero exit status 12_subprocess.calledprocesserror: command 'git tag' r

subprocess.calledprocesserror: command 'git tag' returned non-zero exit stat

在用自己训练好的权重进行test时,出现

  1. Traceback (most recent call last):
  2. File "/home/wjh/learning/yolov7/test.py", line 319, in <module>
  3. test(opt.data,
  4. File "/home/wjh/learning/yolov7/test.py", line 58, in test
  5. model = attempt_load(weights, map_location=device) # load FP32 model
  6. File "/home/wjh/learning/yolov7/models/experimental.py", line 251, in attempt_load
  7. attempt_download(w)
  8. File "/home/wjh/learning/yolov7/utils/google_utils.py", line 31, in attempt_download
  9. tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]
  10. File "/home/wjh/.conda/envs/yolov7/lib/python3.9/subprocess.py", line 424, in check_output
  11. return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  12. File "/home/wjh/.conda/envs/yolov7/lib/python3.9/subprocess.py", line 528, in run
  13. raise CalledProcessError(retcode, process.args,
  14. subprocess.CalledProcessError: Command 'git tag' returned non-zero exit status 128.

尝试过将subprocess.py文件中的check换为Fasle但是并没有作用,经过排除发现,存储权重的文件夹路径中存在大写字母,导致不能查找到正确的权重文件,导致程序需要自动翻墙去官网下载权重,也就导致最后报错。

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号