从0开始Mamba环境搭建

  1. pytorch环境搭建
    首先你需要安装好cuda11.6+ 以及anaconda
conda info --env #查看环境
conda create -n py39 python==3.9 # 创建的时候顺便安装python3.9
conda remove -n xx --all #删除环境,防止手误创建错误

在国内安装python包的速度很慢,需要手动添加镜像,末尾有常用的镜像

  1. 装GPU版pytorch

需要找好pytorch已经对应包的版本,最重要的是CUDA对应pytorch的版本(此处的CUDA为11.6)
进入[pip命令]查看对应版本(https://pytorch.org/get-started/previous-versions/)
在这里插入图片描述

conda activate py39

conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.6 -c pytorch -c nvidia
#or
pip install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 --index-url https://download.pytorch.org/whl/cu118
#or 建议用下面这个
pip install torch-1.13.1+cu116-cp39-cp39-linux_x86_64.whl torchaudio-0.13.1+cu116-cp39-cp39-linux_x86_64.whl torchvision-0.14.1+cu116-cp39-cp39-linux_x86_64.whl
conda install packaging#这个是mamba里面必装的包

这句命令是离线安装对应包, whl为离线包的后缀名.

  1. 装mamba的包

随后安装casual_conv1d,首先用git下载过来,检查版本(1.2.0以上),随后安装

cd dir # 进入操作的目录
conda install packaging
git clone https://github.com/Dao-AILab/causal-conv1d.git cd causal-conv1d
cd causal-conv1d
git checkout v1.2.0
#pip setup.py install #这个命令通常失败,因为没有build
CAUSAL_CONV1D_FORCE_BUILD=TRUE pip install .
####
git clone https://github.com/state-spaces/mamba.git
cd ./mamba
git checkout v1.2.0 # current latest version tag
MAMBA_FORCE_BUILD=TRUE pip install .

至此安装完成

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
http://pypi.mirrors.ustc.edu.cn/ #中国科学技术大学
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
#这个命令的作用是设置conda配置,使其在显示包信息的时候同时显示包的来源渠道(channel)的URL。
#这样可以帮助用户更清楚地了解所使用的包是从哪个渠道下载的,有助于排查和解决包管理中可能出现的问题。
conda config --set show_channel_urls yes

引用:

https://blog.csdn.net/weixin_44007713/article/details/136475398
https://blog.csdn.net/catrtees/article/details/124823207?spm=1001.2014.3001.5502

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值