windows11 wsl2 ubuntu20.04安装vision mamba
安装流程
- vision mamba安装了半天才跑通,记录一下流程
- 在wsl上安装cuda
wget https://developer.download.nvidia.cn/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
sh cuda_11.8.0_520.61.05_linux.run
conda create -n mb python=3.10.13
conda activate mb
pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu118
conda install packaging
- 安装最麻烦的mamba和causal_conv1d
export CUDA_HOME=/usr/local/cuda
pip install causal_conv1d==1.1.0
git clone https://github.com/state-spaces/mamba.git
cd mamba/
pip install .
cd ..
git clone https://github.com/hustvl/Vim.git
cd Vim
cp -rf ./mamba-1p1p1/mamba_ssm /root /home/zc/anaconda3/envs/mb/lib/python3.10/site-packages/
pip install timm mlflow -i https://pypi.tuna.tsinghua.edu.cn/simple
使用cifar-100测试安装成功
- 将datasets.py中的CIFAR路径和download设置好
CUDA_VISIBLE_DEVICES=0 torchrun --master_port=6666 --nproc_per_node=1 main.py --model vim_small_patch16_224_bimambav2_final_pool_mean_abs_pos_embed_with_midclstok_div2 --batch-size 20 --drop-path 0.05 --weight-decay 0.05 --lr 1e-3 --num_workers 1 --data-set CIFAR --data-path ./cifar-100-python --output_dir ./output/vim_small_patch16_224_bimambav2_final_pool_mean_abs_pos_embed_with_midclstok_div2 --no_amp