当前位置:   article > 正文

(全网唯一有效成功解决)Mamba 环境安装:causal-conv1d和mamba-ssm报错解决办法

causal-conv1d

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.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65

新的改变(windows系统下)

按照文中安装Causal-Conv1d是行不通的,既到了这一步

CAUSAL_CONV1D_FORCE_BUILD=TRUE pip install .
  • 1

我们需要修改一下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"
  • 1
  • 2
  • 3
  • 4

改为

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"
  • 1
  • 2
  • 3
  • 4

然后在终端

pip install .
  • 1

注意点!!!!

以上部分会在pip install .操作时获取不到权限

建议直接复制链接在浏览器打开然后下到自己的mamba项目里
**

1.例如这是我的mamba路径

**
在这里插入图片描述

2.搜索git CMD(先修改好setup.py)

在这里插入图片描述

3.在git CMD中操作

在这里插入图片描述
就安装成功了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/677683
推荐阅读
相关标签
  

闽ICP备14008679号