Quin3333 2023-10-27 20:32 采纳率: 62.5%
浏览 17
已结题

yolov5 7.0运行出现问题

从github下载yolov5 7.0后,运行train.py时出现以下报错,请问应该如何解决?


```python
Traceback (most recent call last):
  File "D:\anaconda\envs\yolov5_test\lib\site-packages\git\__init__.py", line 166, in <module>
    refresh()
  File "D:\anaconda\envs\yolov5_test\lib\site-packages\git\__init__.py", line 153, in refresh
    if not Git.refresh(path=path):
  File "D:\anaconda\envs\yolov5_test\lib\site-packages\git\cmd.py", line 391, in refresh
    raise ImportError(err)
ImportError: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
    - quiet|q|silence|s|none|n|0: for no warning or exception
    - warn|w|warning|1: for a printed warning
    - error|e|raise|r|2: for a raised exception

Example:
    export GIT_PYTHON_REFRESH=quiet


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "F:/code_new/yolov5-7.0/train.py", line 66, in <module>
    GIT_INFO = check_git_info()
  File "D:\anaconda\envs\yolov5_test\lib\contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "F:\code_new\yolov5-7.0\utils\general.py", line 350, in check_git_info
    import git
  File "D:\anaconda\envs\yolov5_test\lib\site-packages\git\__init__.py", line 168, in <module>
    raise ImportError("Failed to initialize: {0}".format(_exc)) from _exc
ImportError: Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
    - quiet|q|silence|s|none|n|0: for no warning or exception
    - warn|w|warning|1: for a printed warning
    - error|e|raise|r|2: for a raised exception

Example:
    export GIT_PYTHON_REFRESH=quiet

```

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 已结题 (查看结题原因) 10月27日
    • 创建了问题 10月27日

    悬赏问题

    • ¥15 无源定位系统的时差估计误差标准差
    • ¥15 请问这个代码哪里有问题啊
    • ¥20 python--version在命令端输入结果Python is not defined怎么办?还有pip不是exe格式是不是没安装成功?
    • ¥15 通过GaussianView进行结构微调消除虚频
    • ¥15 调用transformers库
    • ¥15 由于导出的数据名字中带有/,导致Matlab打不开,怎么办?
    • ¥15 新硬盘安装的程序总是崩溃,提示遇到错误
    • ¥15 openpcdet自制数据集评估bev精度和3d精度相同
    • ¥15 excel 上下按钮 显示行
    • ¥20 云卓h12pro 数传问题