当前位置: 首页 > news >正文

配置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): startedPreparing 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, VersionModuleNotFoundError: 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.failedCondaEnvException: Pip failed

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

所以:

conda install packaging

再输入命令:

conda env update -f environment.yaml

 报错啦

Building wheels for collected packages: mamba-ssmBuilding wheel for mamba-ssm (setup.py): startedBuilding 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-ssmPip 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.1running bdist_wheelGuessing 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.whlerror: <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 projectsfailedCondaEnvException: Pip failed

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

输入:

 source /data/home/sczc338/run/soft/cuda11.7/env.sh

再输入:

conda env update -f environment.yaml

然后就成功了!!!

相关文章:

  • Sql刷题日志(day5)
  • 说一下Redis的发布订阅模型和PipeLine
  • OpenBayes 一周速览|EasyControl 高效控制 DiT 架构,助力吉卜力风图像一键生成;TripoSG 单图秒变高保真 3D 模型
  • leetcode hot100尝试1
  • 零基础入门 Verilog VHDL:在线仿真与 FPGA 实战全流程指南
  • 鸿蒙中的并发线程间通信、线程间通信对象
  • 状态模式(State Pattern)详解
  • Python | 分层线性模型的实现及示例
  • 什么是鸿蒙南向开发?什么是北向开发?
  • PHP 反序列化原生类 TIPS字符串逃逸CVE 绕过漏洞属性类型特征
  • 集结号海螺捕鱼游戏源码解析(第二篇):水浒传捕鱼模块逻辑与服务器帧同步详解
  • 2025山东省职业院校技能大赛网络安全赛项样题
  • node.js 实战——(path模块 知识点学习)
  • 解决重装idea后破解jerbel的问题
  • (一)单机架构、应用数据分离架构、应用服务集群架构
  • JavaScript学习教程,从入门到精通,Ajax与Node.js Web服务器开发全面指南(24)
  • 基于javaweb的SpringBoot扶农助农平台管理系统设计与实现(源码+文档+部署讲解)
  • 前端面试场景题
  • JVM学习笔记
  • MCP 协议:AI 时代的 “USB-C” 革命——从接口统一到生态重构的技术哲学
  • 中方警告韩国公司不要向美军工企业出口含中国稀土矿物产品?外交部回应
  • 深一度|王励勤二次创业从未停步,带领中国乒乓直面挑战
  • 龚正会见巴西里约热内卢州州长克劳迪奥·卡斯特罗
  • 全球在役最大火电厂被通报
  • 南京信息工程大学商学院讲师李玮玮逝世,终年45岁
  • 钱理群|直面衰老与死亡