Linux安装 Anaconda、Tensorflow-GPU、Keras、pytorch-gpu过程

linux安装anaconda

一定要进入anaconda官网 查看对应的你想安装的python3.x and linux的版本--即sh文件例如(Anaconda3-5.2.0-Linux-x86_64.sh)。然后利用 bash Anaconda3-5.2.0-Linux-x86_64.sh 即可。最后或有一个选择:
Do you wish the installer to initialize Anaconda3 in your /home/lab-xu.zhenyuan/.bashrc ? [yes|no]
选择 [no] 。然后在有一个需要添加一个 .profile文件,然后在里面修改。修改内容如下:

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
export PATH=~/anaconda3/bin:$PATH

最后一行就是添加的内容 其中export PATH=~/anaconda3/bin:$PATH 中的~/anaconda3/bin:为自己的文件地址。
这样可以将linux 原本的python 换成anaconda里面的python。

linux安装tensorflow-gpu

首先需要添加清华镜像连接,然后采用conda指令加速安装文件。清华镜像链接:
https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
步骤:
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 --set show_channel_urls yes
然后conda install tensorflow-gpu 即可

linux 安装pytorch-gpu

同样conda install pytorch-gpu即可

linux安装keras

直接采用pip install keras即可

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容