赞
踩
本人欲魔改Mamba,在复现Vision Mamba时发现环境依赖难以搭建,经过多次尝试,现已成功。
conda install cudatoolkit==11.8 -c nvidia
实现conda的cuda管理causal-conv1d
与mamba-ssm
以及对应的whl文件# 1. 创建自己的虚拟环境 conda create -n VisionMamba python=3.10.13 conda activate VisionMamba # 2. cuda-11.8 conda install cudatoolkit==11.8 -c nvidia # 3. torch torchvision torchaudio 与 官网命令一致 pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu118 # 4. nvcc conda install -c "nvidia/label/cuda-11.8.0" cuda-nvcc # 5. packaging conda install packaging # 6. causal-conv1d== & mamba-ssm==1.1.1 ## 下载相应zip以及whl文件至Vim文件夹下 git clone https://github.com/hustvl/Vim.git ### mamba-ssm https://github.com/state-spaces/mamba/releases/download/v1.1.1/mamba_ssm-1.1.1%2Bcu118torch2.1cxx11abiFALSE-cp310-cp310-linux_x86_64.whl https://github.com/state-spaces/mamba/archive/refs/tags/v1.1.1.zip ### causal-conv1d https://github.com/Dao-AILab/causal-conv1d/releases/download/v1.1.3/causal_conv1d-1.1.3%2Bcu118torch2.1cxx11abiFALSE-cp310-cp310-linux_x86_64.whl https://github.com/Dao-AILab/causal-conv1d/archive/refs/tags/v1.1.3.zip # 7. unzip & pip install cd Vim unzip causal-conv1d-1.1.3.zip -d ./ cd causal-conv1d-1.1.3 pip install . cd .. unzip mamba_ssm-1.1.1.zip -d ./ cd mamba_ssm-1.1.1 pip install . cd .. # 8. Vim 环境依赖 pip install -r vim/vim_requirements.txt # 9. 更换mamaba1p1p/mamba/ 至 mamba-ssm ## 删除原环境里的mamba_ssm文件夹 rm -rf "/home/[usr_name]/miniconda/envs/VisionMamba/lib/python3.10/site-packages/mamba_ssm/" ## Vim下mamba_ssm文件夹替换进去 cp -r "/home/[usr_name]/Vim/mamba-1p1p1/mamba_ssm" "/home/[usr_name]/miniconda/envs/VisionMamba/lib/python3.10/site-packages/"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。