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即可

你可能感兴趣的:(Linux安装 Anaconda、Tensorflow-GPU、Keras、pytorch-gpu过程)