赞
踩
Mamba 环境安装:causal-conv1d和mamba-ssm报错解决办法
主要参考链接: (Windows傻瓜教程)Mamba安装以及问题汇总(Causal-Conv1d & Mamba-ssm)
.
一定要下好visual studio 然后下C++!!!不然装不了会出现以下报错 很多人cuda版本对了但是安装不了就是因为没装c++,就会导致有的装成功了,有的人没装成功(全网第一个发现这个问题的,我参考了很多博客都有的人解决了有的人没解决,然后自己去看报错发现了)。
参考链接visual studio C++
.
E:\A\Anaconda\lib\site-packages\torch\utils\cpp_extension.py:348: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。 warnings.warn(f'Error checking compiler version for {compiler}: {error}') Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "E:\B\paperlearn\Vision_Mamba\Vim-main\Vim-main\kelong\causal-conv1d\setup.py", line 227, in <module> setup( File "E:\A\Anaconda\lib\site-packages\setuptools\__init__.py", line 87, in setup return distutils.core.setup(**attrs) File "E:\A\Anaconda\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup return run_commands(dist) File "E:\A\Anaconda\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands dist.run_commands() File "E:\A\Anaconda\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands self.run_command(cmd) File "E:\A\Anaconda\lib\site-packages\setuptools\dist.py", line 1208, in run_command super().run_command(command) File "E:\A\Anaconda\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command cmd_obj.run() File "E:\A\Anaconda\lib\site-packages\setuptools\command\install.py", line 68, in run return orig.install.run(self) File "E:\A\Anaconda\lib\site-packages\setuptools\_distutils\command\install.py", line 698, in run self.run_command('build') File "E:\A\Anaconda\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command self.distribution.run_command(command) File "E:\A\Anaconda\lib\site-packages\setuptools\dist.py", line 1208, in run_command super().run_command(command) File "E:\A\Anaconda\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command cmd_obj.run() File "E:\A\Anaconda\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run self.run_command(cmd_name) File "E:\A\Anaconda\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command self.distribution.run_command(command) File "E:\A\Anaconda\lib\site-packages\setuptools\dist.py", line 1208, in run_command super().run_command(command) File "E:\A\Anaconda\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command cmd_obj.run() File "E:\A\Anaconda\lib\site-packages\setuptools\command\build_ext.py", line 84, in run _build_ext.run(self) File "E:\A\Anaconda\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 346, in run self.build_extensions() File "E:\A\Anaconda\lib\site-packages\torch\utils\cpp_extension.py", line 436, in build_extensions self._check_cuda_version(compiler_name, compiler_version) File "E:\A\Anaconda\lib\site-packages\torch\utils\cpp_extension.py", line 813, in _check_cuda_version torch_cuda_version = packaging.version.parse(torch.version.cuda) File "E:\A\Anaconda\lib\site-packages\pkg_resources\_vendor\packaging\version.py", line 49, in parse return Version(version) File "E:\A\Anaconda\lib\site-packages\pkg_resources\_vendor\packaging\version.py", line 264, in __init__ match = self._regex.search(version) TypeError: expected string or bytes-like object [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. Rolling back uninstall of causal-conv1d Moving to c:\users\ql\appdata\roaming\python\python310\site-packages\causal_conv1d-1.2.0.post2.dist-info\ from C:\Users\ql\AppData\Roaming\Python\Python310\site-packages\~ausal_conv1d-1.2.0.post2.dist-info Moving to c:\users\ql\appdata\roaming\python\python310\site-packages\causal_conv1d\ from C:\Users\ql\AppData\Roaming\Python\Python310\site-packages\~ausal_conv1d error: legacy-install-failure × Encountered error while trying to install package. ╰─> causal-conv1d note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.
按照文中安装Causal-Conv1d是行不通的,既到了这一步
CAUSAL_CONV1D_FORCE_BUILD=TRUE pip install .
我们需要修改一下set.py文件
将原来的(在前几行,我的在37行)
FORCE_BUILD = os.getenv("CAUSAL_CONV1D_FORCE_BUILD", "FALSE").upper() == "TRUE"
SKIP_CUDA_BUILD = os.getenv("CAUSAL_CONV1D_SKIP_CUDA_BUILD", "FALSE") == "TRUE"
# For CI, we want the option to build with C++11 ABI since the nvcr images use C++11 ABI
FORCE_CXX11_ABI = os.getenv("CAUSAL_CONV1D_FORCE_CXX11_ABI", "FALSE") == "TRUE"
改为
FORCE_BUILD = os.getenv("CAUSAL_CONV1D_FORCE_BUILD", "TRUE").upper() == "TRUE"
SKIP_CUDA_BUILD = os.getenv("CAUSAL_CONV1D_SKIP_CUDA_BUILD", "False") == "TRUE"
# For CI, we want the option to build with C++11 ABI since the nvcr images use C++11 ABI
FORCE_CXX11_ABI = os.getenv("CAUSAL_CONV1D_FORCE_CXX11_ABI", "False") == "TRUE"
然后在终端
pip install .
建议直接复制链接在浏览器打开然后下到自己的mamba项目里
**
**
就安装成功了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。