subprocess.CalledProcessError: Command ‘[‘git‘, ‘describe‘]‘ returned non-zero exit status 128

这篇具有很好参考价值的文章主要介绍了subprocess.CalledProcessError: Command ‘[‘git‘, ‘describe‘]‘ returned non-zero exit status 128。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Q:在跑CenterTrack的时候遇到了下面问题:
 

  File "main.py", line 101, in <module>
    main(opt)
  File "main.py", line 37, in main
    logger = Logger(opt)
  File "/home/xxx/CenterTrack/src/lib/logger.py", line 33, in __init__
    subprocess.check_output(["git", "describe"])))
  File "/home/xx/anaconda3/envs/CenterTrack/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/xx/anaconda3/envs/CenterTrack/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'describe']' returned non-zero exit status 128.

解决:

1)将logger.py中的下面几行注释了

    with open(file_name, 'wt') as opt_file:
      # opt_file.write('==> commit hash: {}\n'.format(
      #   subprocess.check_output(["git", "describe"])))
      opt_file.write('==> torch version: {}\n'.format(torch.__version__))
      opt_file.write('==> cudnn version: {}\n'.format(


2)将subprocess.py中415行中的check=True改为False。

影响:

当子进程返回非零退出码时,subprocess就不会引发CalledProcessError异常。相反,它将静默失败,并继续执行剩余的代码。你将需要自己检查返回码(通过subprocess.CompletedProcess.returncode)来确定子进程是否成功执行。

这可能有助于防止一些错误,如尝试运行不存在的命令或在非Git目录中运行git describe命令等。然而,这也可能使你错过一些重要的错误信息,因为你的代码可能在出现错误的情况下仍然继续执行。你需要根据你的特定需求来决定是否要设置check=False。文章来源地址https://www.toymoban.com/news/detail-761469.html

到了这里,关于subprocess.CalledProcessError: Command ‘[‘git‘, ‘describe‘]‘ returned non-zero exit status 128的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • [VoteNet]报错出现错误“subprocess.CalledProcessError: Command ‘[‘ninja‘, ‘-v‘]‘ returned nonzero exit state

    尝试运行votenet baseline 服务器环境: NVIDIA RTX3090 Pytorch 1.8.1 CUDA11.1 在run demo的时候尝试对pointnet2的一众cpp文件进行编译,运行python setup.py install时出现报错,报错信息为‘ubprocess.CalledProcessError: Command ‘[‘ninja‘, ‘-v‘]‘ returned nonzero exit state 1’ pytorch版本和源代码所使用的

    2024年02月13日
    浏览(28)
  • raise CalledProcessError(retcode, process.args,subprocess.CalledProcessError: Command ‘git tag‘

    yolov7报错解决方案 fatal: not a git repository (or any of the parent directories): .git Traceback (most recent call last):   File \\\"D:pythoncodehumanposeyolo3DPosedemoyolov7utilsgoogle_utils.py\\\", line 26, in attempt_download     assets = [x[\\\'name\\\'] for x in response[\\\'assets\\\']]  # release assets KeyError: \\\'assets\\\' During handling of the above e

    2024年02月03日
    浏览(33)
  • python自带的venv创建虚拟环境报错Error: Command returned non-zero exit status 1.

    Windows 10 教育版64位 Python 3.6.3 今天使用 python 自带的 venv 使用如下的命令: 创建虚拟环境报错: Error: Command \\\'[\\\'E:\\\\Code\\\\Python\\\\Git\\\\test1\\\\aaa\\\\Scripts\\\\python.exe\\\', \\\'-Im\\\', \\\'ensurepip\\\', \\\'--upgrade\\\', \\\'--default-pip\\\']\\\' returned non-zero exit status 1.) 这个时候,回到你需要创建 venv 的路径,发现我的新环境

    2024年02月16日
    浏览(28)
  • spconv1.2.1安装时出现subprocess.CalledProcessError错误的解决方法

    问题详述: 描述: 该问题是在你安装spconv1.0/1.2.1时,执行python setup.py bdist_wheel时,编译一半出现的问题。 可能1 :此问题说明spconv安装缺文件,从官方下载下来的spconv1.2.1,文件夹下的third_party/pybind11是空的,需要自己手动去下载。 pybind11链接:https://github.com/pybind/pybind11/t

    2024年02月09日
    浏览(30)
  • 【Error】Win10/Python3.9安装dlib报错:subprocess.CalledProcessError以及解决方法

    注意python3.9就选择cp39的dlib包,否则报错: ERROR: dlib-19.7.0-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform. https://blog.csdn.net/DoubleJ2/article/details/115399326 显示 我没有安装Vc++,但是我已经安装好了 官网下载免费社区版,并且进入D盘cl命令后,确认已经安装 命令行找到cd D:vs

    2024年02月05日
    浏览(30)
  • stable diffusion 运行时报错: returned non-zero exit status 1.

    运行sh run.sh安装stable diffusion时报错:ImportError: cannot import name \\\'builder\\\' from \\\'google.protobuf.internal\\\' (stable-diffusion-webui/venv/lib/python3.8/site-packages/google/protobuf/internal/__init__.py) 原因:python版本过低,使用3.10 ubuntu安装python3.10: 重新安装venv: python3.10 -m venv venv 报错:Error: Command \\\'[\\\'stable

    2024年02月12日
    浏览(27)
  • Jenkins连接git时出现“Failed to connect to repository : Command ... HEAD“ returned status code 128:”问题解决

    目录 问题 解决 配置仓库时报错: Failed to connect to repository : Command \\\"git.exe ls-remote -h -- http://192.168.0.XXX/XXX/cicd.git HEAD\\\" returned status code 128: stdout: stderr: remote: The project you were looking for could not be found. fatal: repository \\\'http://192.168.0.XXX/XXXX/cicd.git/\\\' not found   原因是我的gitlab仓库设置了权

    2024年02月12日
    浏览(32)
  • git 报错The requested URL returned error: 403

    目录 修改git 配置信息用户名和邮箱(无效) 修改当前项目下的git文件夹中的config(无效) 清除缓存(有效) 优化:每次拉取代码都要输入用户名和密码 今日更换电脑,从云效平台拉取代码报错。 原因:自己的账号和电脑上之前的Git账户有冲突,需清除缓存 主要参考:解

    2024年02月06日
    浏览(37)
  • 执行git操作报错:The requested URL returned error: 500

    因为疫情居家办公了,然后家里面有一个台式机,就使用了台式机,结果想从git仓库重新拉取代码就报错了: 然后从网上找各种解决办法,都不生效,我突然记起自己的git密码重新修改过,修改密码之后没有在台式机上办过公,所以就重新设置了一下git的密码,如下: 使用

    2024年02月11日
    浏览(41)
  • git clone项目报错,The requested URL returned error: 500

    git clone项目报错,The requested URL returned error: 500,如何解决?试试修改电脑中存储的账号密码 有项目权限,至少在网页上能通过链接访问当前Git内容 曾在当前电脑登录过git账号 满足以上两种情况,但执行git clone时却报错The requested URL returned error: 500 在Windows系统中试试以下方法

    2024年02月12日
    浏览(35)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包