文章目錄
- 方法1、下載whl文件到本地后pip install
- 安裝成功后驗證:
- 方法2、拉取Docker鏡像
對于項目中用到MambaIR的小伙伴,需要pip安裝
causal_conv1d
和
mamba-ssm
兩個包及其依賴:
torch
packing
transformers
MambaIR-Github主頁(含installation)
This codebase was tested with the following environment configurations. It may work with other versions:
Ubuntu 20.04
CUDA 11.7
Python 3.9
PyTorch 1.13.1 + cu117
方法1、下載whl文件到本地后pip install
安裝順序參照:Mamba 環境安裝踩坑問題匯總及解決方法方法三
conda create -n your_env_name python=3.10.13
conda activate your_env_name
conda install cudatoolkit==11.8 -c nvidia
pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu118
conda install -c "nvidia/label/cuda-11.8.0" cuda-nvcc
conda install packaging
pip install causal-conv1d==1.1.1
pip install mamba-ssm
當遇到causal-conv1d或mamba-ssm長時間building wheel卡著不動后error…的情況,我的解決方法是:
下載causal-conv1d
Dao-AILabcausal-conv1d
和mamba-ssm
state-spacesmamba
的whl文件,并pip install本地安裝;源碼安裝、注釋版本號限制、更換CUDA,torch版本筆者也嘗試過,均不可行。
下載很慢的話換臺電腦試試,跟新舊網卡有點關系。。
如我的conda環境:
centos
CUDA 11.8
Python 3.9.4
PyTorch 2.1.0 + cu118
則mamba-ssm的whl需要選擇:mamba_ssm-1.0.1+cu118torch2.1cxx11abiFALSE-cp39-cp39-linux_x86_64.whl
安裝成功后驗證:
方法2、拉取Docker鏡像
參考:直接使用Mamba基礎環境docker鏡像