配置MambaIRv2: Attentive State Space Restoration的环境

github上代码的地址:

csguoh/MambaIR: [ECCV2024, CVPR2025] MambaIR and MambaIRv2!

一开始直接输入命令

复制代码
conda env create -f environment.yaml

安装了半天爆出来好几个错误,其中一个是没有nvcc

输入以下命令:

复制代码
module avail

发现没有对应的cuda11.7的版本

就安装cuda11.7的

然后输入以下命令激活环境:

复制代码
 source /data/home/sczc338/run/soft/cuda11.7/env.sh

把这个问题解决了

具体的可以看一下这篇文章:

.whl文件-CSDN博客

里面有如何在超算上安装相应cuda版本的详细步骤

还有一个是什么包找不到好像是。

因为这里默认安装包从defaults通道,但这里的包实际上更新比较慢,所以我使用了如下命令让conda-forge通道为优先级最高的通道(conda-forge是社区驱动的,更新包较快)(conda-forge is a community effort that provides conda packages for a wide range of software.)

  • Make sure you have conda >=4.9:

    复制代码
    conda --version
    conda update conda
  • Add conda-forge as the highest priority channel:

    复制代码
    conda config --add channels conda-forge
  • Activate strict channel priority (strict will be activated by default in conda 5.0):

    复制代码
    conda config --set channel_priority strict

具体的可以看一下这一篇文章:

conda和pip的区别-CSDN博客

然后还爆出了一堆的问题,解决着解决着,发现我这个mambair环境竟然用的是python3.8的版本,但是安装的东西都是基于python3.9的。(包括the mamba_ssm library)

我想输入以下命令来更改环境的python版本,但是报错啦,不知道什么原因

复制代码
conda install python=3.9

输入以下命令查看python版本:

复制代码
python --version

所以我把现有的mambair环境删了,再重新创一个

复制代码
conda create -n mambair python=3.9

此时如果再运行命令:

复制代码
conda env create -f environment.yaml

就会报出mambair环境已存在的错误,所以使用以下命令:

复制代码
(mambair) sczc338@ln01:~/run/MambaIR$ conda env update -f environment.yaml

报出如下错误:

复制代码
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'

Pip subprocess error:
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-ct238nq5/mamba-ssm_3efcc205c45c42afaa3b469462840fa1/setup.py", line 8, in <module>
          from packaging.version import parse, Version
      ModuleNotFoundError: No module named 'packaging'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

failed

CondaEnvException: Pip failed

主要注意这句话: ModuleNotFoundError: No module named 'packaging'

所以:

复制代码
conda install packaging

再输入命令:

复制代码
conda env update -f environment.yaml

报错啦

复制代码
Building wheels for collected packages: mamba-ssm
  Building wheel for mamba-ssm (setup.py): started
  Building wheel for mamba-ssm (setup.py): still running...
  Building wheel for mamba-ssm (setup.py): finished with status 'error'
  Running setup.py clean for mamba-ssm
Failed to build mamba-ssm

Pip subprocess error:
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      No CUDA runtime is found, using CUDA_HOME='/data/home/sczc338/run/soft/cuda11.7'


      torch.__version__  = 2.0.1


      running bdist_wheel
      Guessing wheel URL:  https://github.com/state-spaces/mamba/releases/download/v1.0.1/mamba_ssm-1.0.1+cu118torch2.0cxx11abiFALSE-cp38-cp38-linux_x86_64.whl
      error: <urlopen error retrieval incomplete: got only 115343360 out of 146629955 bytes>
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mamba-ssm
ERROR: Could not build wheels for mamba-ssm, which is required to install pyproject.toml-based projects

failed

CondaEnvException: Pip failed

hh应该是因为我没有启动cuda环境回去再弄。

输入:

复制代码
 source /data/home/sczc338/run/soft/cuda11.7/env.sh

再输入:

复制代码
conda env update -f environment.yaml

然后就成功了!!!

相关推荐
lifallen1 小时前
Java Stream sort算子实现:SortedOps
java·开发语言
IT毕设实战小研1 小时前
基于Spring Boot 4s店车辆管理系统 租车管理系统 停车位管理系统 智慧车辆管理系统
java·开发语言·spring boot·后端·spring·毕业设计·课程设计
wyiyiyi2 小时前
【Web后端】Django、flask及其场景——以构建系统原型为例
前端·数据库·后端·python·django·flask
mit6.8242 小时前
[1Prompt1Story] 滑动窗口机制 | 图像生成管线 | VAE变分自编码器 | UNet去噪神经网络
人工智能·python
没有bug.的程序员2 小时前
JVM 总览与运行原理:深入Java虚拟机的核心引擎
java·jvm·python·虚拟机
甄超锋2 小时前
Java ArrayList的介绍及用法
java·windows·spring boot·python·spring·spring cloud·tomcat
cui__OaO3 小时前
Linux软件编程--线程
linux·开发语言·线程·互斥锁·死锁·信号量·嵌入式学习
鱼鱼说测试3 小时前
Jenkins+Python自动化持续集成详细教程
开发语言·servlet·php
AntBlack3 小时前
不当韭菜V1.1 :增强能力 ,辅助构建自己的交易规则
后端·python·pyqt
艾莉丝努力练剑4 小时前
【洛谷刷题】用C语言和C++做一些入门题,练习洛谷IDE模式:分支机构(一)
c语言·开发语言·数据结构·c++·学习·算法