HZAI-ZJNU / Mamba-YOLO

the official pytorch implementation of “Mamba-YOLO:SSMs-based for Object Detection”
Apache License 2.0
275 stars 34 forks source link

cd selective_scan &&pip install . 一直报错 #39

Open LukasYan30 opened 3 months ago

LukasYan30 commented 3 months ago

报错信息如下:Processing /data/yhl/mamba/Mamba-YOLO-main/selective_scan Preparing metadata (setup.py) ... done Requirement already satisfied: torch in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from selective_scan==0.0.2) (2.3.1+cu118) Collecting packaging (from selective_scan==0.0.2) Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB) Collecting ninja (from selective_scan==0.0.2) Using cached ninja-1.11.1.1-py2.py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl.metadata (5.3 kB) Collecting einops (from selective_scan==0.0.2) Using cached einops-0.8.0-py3-none-any.whl.metadata (12 kB) Requirement already satisfied: filelock in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (3.15.4) Requirement already satisfied: typing-extensions>=4.8.0 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (4.12.2) Requirement already satisfied: sympy in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (1.13.1) Requirement already satisfied: networkx in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (3.3) Requirement already satisfied: jinja2 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (3.1.4) Requirement already satisfied: fsspec in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (2024.6.1) Requirement already satisfied: nvidia-cuda-nvrtc-cu11==11.8.89 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (11.8.89) Requirement already satisfied: nvidia-cuda-runtime-cu11==11.8.89 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (11.8.89) Requirement already satisfied: nvidia-cuda-cupti-cu11==11.8.87 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (11.8.87) Requirement already satisfied: nvidia-cudnn-cu11==8.7.0.84 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (8.7.0.84) Requirement already satisfied: nvidia-cublas-cu11==11.11.3.6 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (11.11.3.6) Requirement already satisfied: nvidia-cufft-cu11==10.9.0.58 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (10.9.0.58) Requirement already satisfied: nvidia-curand-cu11==10.3.0.86 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (10.3.0.86) Requirement already satisfied: nvidia-cusolver-cu11==11.4.1.48 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (11.4.1.48) Requirement already satisfied: nvidia-cusparse-cu11==11.7.5.86 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (11.7.5.86) Requirement already satisfied: nvidia-nccl-cu11==2.20.5 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (2.20.5) Requirement already satisfied: nvidia-nvtx-cu11==11.8.86 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (11.8.86) Requirement already satisfied: triton==2.3.1 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from torch->selective_scan==0.0.2) (2.3.1) Requirement already satisfied: MarkupSafe>=2.0 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from jinja2->torch->selective_scan==0.0.2) (2.1.5) Requirement already satisfied: mpmath<1.4,>=1.1.0 in /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages (from sympy->torch->selective_scan==0.0.2) (1.3.0) Using cached einops-0.8.0-py3-none-any.whl (43 kB) Using cached ninja-1.11.1.1-py2.py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl (307 kB) Using cached packaging-24.1-py3-none-any.whl (53 kB) Building wheels for collected packages: selective_scan Building wheel for selective_scan (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [32 lines of output]

  torch.__version__  = 2.3.1+cu118

  CUDA_HOME = /root/miniconda3/envs/mambayolo

  CUDA version:  11.8
  running bdist_wheel
  /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages/torch/utils/cpp_extension.py:499: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
    warnings.warn(msg.format('we could not find ninja.'))
  running build
  running build_ext
  /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages/torch/utils/cpp_extension.py:428: UserWarning: There are no g++ version bounds defined for CUDA version 11.8
    warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')
  building 'selective_scan_cuda_core' extension
  creating build
  creating build/temp.linux-x86_64-cpython-310
  creating build/temp.linux-x86_64-cpython-310/csrc
  creating build/temp.linux-x86_64-cpython-310/csrc/selective_scan
  creating build/temp.linux-x86_64-cpython-310/csrc/selective_scan/cus
  gcc -pthread -B /root/miniconda3/envs/mambayolo/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /root/miniconda3/envs/mambayolo/include -fPIC -O2 -isystem /root/miniconda3/envs/mambayolo/include -fPIC -I/data/yhl/mamba/Mamba-YOLO-main/selective_scan/csrc/selective_scan -I/root/miniconda3/envs/mambayolo/lib/python3.10/site-packages/torch/include -I/root/miniconda3/envs/mambayolo/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/envs/mambayolo/lib/python3.10/site-packages/torch/include/TH -I/root/miniconda3/envs/mambayolo/lib/python3.10/site-packages/torch/include/THC -I/root/miniconda3/envs/mambayolo/include -I/root/miniconda3/envs/mambayolo/include/python3.10 -c csrc/selective_scan/cus/selective_scan.cpp -o build/temp.linux-x86_64-cpython-310/csrc/selective_scan/cus/selective_scan.o -O3 -std=c++17 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=selective_scan_cuda_core -D_GLIBCXX_USE_CXX11_ABI=0
  In file included from /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAContext.h:3,
                   from csrc/selective_scan/cus/selective_scan.cpp:5:
  /root/miniconda3/envs/mambayolo/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAContextLight.h:6:10: fatal error: cuda_runtime_api.h: No such file or directory
      6 | #include <cuda_runtime_api.h>
        |          ^~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command '/root/miniconda3/envs/mambayolo/bin/gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for selective_scan Running setup.py clean for selective_scan Failed to build selective_scan ERROR: Could not build wheels for selective_scan, which is required to install pyproject.toml-based projects 我已正确安装了gcc11版本的,但是还是未解决这个问题。

Shen-LW commented 3 months ago

selective_scan来自vmanba,解决可以参考:https://blog.csdn.net/yyywxk/article/details/140422758