Traceback (most recent call last):
File "D:\pycharm\yolov5\yolov5\train.py", line 100, in <module>
GIT_INFO = check_git_info()
^^^^^^^^^^^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "D:\pycharm\yolov5\yolov5\utils\general.py", line 405, in check_git_info
import git
File "C:\Users\fsy\.conda\envs\yolov5\Lib\site-packages\git\__init__.py", line 298, 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(<full-path-to-git-executable>)
All git commands will error until this is rectified.
This initial message 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|silent|none|n|0: for no message or exception
- warn|w|warning|log|l|1: for a warning message (logging level CRITICAL, displayed by default)
- error|e|exception|raise|r|2: for a raised exception
Example:
export GIT_PYTHON_REFRESH=quiet
(yolov5) PS D:\pycharm\yolov5\yolov5> python train.py
Traceback (most recent call last):
File "C:\Users\fsy\.conda\envs\yolov5\Lib\site-packages\git\cmd.py", line 1262, in execute
proc = safer_popen(
^^^^^^^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\site-packages\git\cmd.py", line 281, in _safer_popen_windows
return Popen(
^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\fsy\.conda\envs\yolov5\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\pycharm\yolov5\yolov5\train.py", line 102, in <module>
GIT_INFO = check_git_info()
^^^^^^^^^^^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "D:\pycharm\yolov5\yolov5\utils\general.py", line 410, in check_git_info
commit = repo.head.commit.hexsha # i.e. '3134699c73af83aac2a481435550b968d5792c0d'
^^^^^^^^^^^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\site-packages\git\refs\symbolic.py", line 297, in _get_commit
obj = self._get_object()
^^^^^^^^^^^^^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\site-packages\git\refs\symbolic.py", line 288, in _get_object
return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\site-packages\git\objects\base.py", line 149, in new_from_sha
oinfo = repo.odb.info(sha1)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\site-packages\git\db.py", line 41, in info
hexsha, typename, size = self._git.get_object_header(bin_to_hex(binsha))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\site-packages\git\cmd.py", line 1678, in get_object_header
cmd = self._get_persistent_cmd("cat_file_header", "cat_file", batch_check=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\site-packages\git\cmd.py", line 1654, in _get_persistent_cmd
cmd = self._call_process(cmd_name, *args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\site-packages\git\cmd.py", line 1599, in _call_process
return self.execute(call, **exec_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fsy\.conda\envs\yolov5\Lib\site-packages\git\cmd.py", line 1276, in execute
raise GitCommandNotFound(redacted_command, err) from err
git.exc.GitCommandNotFound: Cmd('git') not found due to: FileNotFoundError('[WinError 2] 系统找不到指定的文件。')
cmdline: git cat-file --batch-check
(yolov5) PS D:\pycharm\yolov5\yolov5>
最新发布