Skip to content

python

约 119 个字 17 行代码 4 张图片 预计阅读时间 1 分钟

Address already in use

问题:RuntimeError: Can't listen for client connections: [Errno 98] Address already in use

这边建议您还是正常的断开连接、退出调试,别意外中断。

cuda 与 pytorch 版本不兼容

Python
    File "/home/student2023/xiehr2023/GeCo-main/geco_test/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 552, in build_extensions
      _check_cuda_version(compiler_name, compiler_version)
    File "/home/student2023/xiehr2023/GeCo-main/geco_test/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 447, in _check_cuda_version
      raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))
  RuntimeError:
  The detected CUDA version (12.3) mismatches the version that was used to compile
  PyTorch (11.8). Please make sure to use the same CUDA versions.

  [end of output]

image-20250221142652927

Python
pip uninstall torch torchvision torchaudio
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu123

image-20250221142730850

从 github 上安装 python 库

本地使用 git 安装

第一步,安装 git

Bash
apt-get update
apt-get install -y git

🟢 第二步,克隆远程仓库到本地:

Bash
git clone https://github.com/facebookresearch/detectron2.git
第三步,进入目录(github 上的根目录)并安装

Bash
cd detectron2

image-20250227211259636

Bash
python setup.py install

补充:如果 zip 下载下来的,需要进入

image-20250227211829255

另外一种安装。

Bash
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
add_circle2025-02-21 13:33:13update2025-03-07 18:51:21