Centos下Miniconda安装tensorflow

一.安装Miniconda

  1. 下载Miniconda(3版本的最新版本,可根据自己的需要去选择):

    wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

  2. 给安装文件添加执行权限:

    chmod 755 Miniconda3-latest-Linux-x86_64.sh

  3. 执行安装:

    ./Miniconda3-latest-Linux-x86_64.sh

  4. 根据提示进行操作:并不是全部都是选择yes,比如问是否修改安装路径,添加到环境变量等,可根据自己的需求进行操作。
  5. 启动conda:

    到安装路径下的bin目录下
    source activate #启动conda

  6. 添加Miniconda安装频道,这里选择清华的镜像:

    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/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/

二.安装python

  • 根据自己的选择安装python,安装完后conda会创建一个叫py3的环境。

    conda create -n py3 python=3
    # -n py3表示重命名python
    # python=3 也可以具体到python=3.6,甚至python=3.6.9
    source activate py3 # 启动python环境
    source deactivate py3 # 退出python环境

三.安装tensorflow

  1. 在刚才的python环境中,用pip安装tensorflow

    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==1.13.1
    # https://pypi.tuna.tsinghua.edu.cn/simple 清华镜像,安装快。
    # tensorflow-gpu == 1.13.1 可将tensorflow-gpu换为tensorflow,后面的1.13.1也可根据自己的需要修改

  2. 至此,tensorflow安装完成。

    source deactivate #退出环境
    # 也可以将activate添加值环境变量中:
    vim /ect/profile
    PATH=$PATH:/miniconda/miniconda3/bin # /miniconda/miniconda3/bin具体路径
    export PATH
    source /etc/profile # 让文件生效

四.经验之谈

  1. 不要排斥Miniconda,总的来说,还是非常好用的。
  2. 深度学习,要学会使用国内的资源镜像,这对获取相关资源帮助非常大。
  3. 不断尝试。
  4. 参考链接
  5. 更多交流,可加微信:
    相关技术微信同步
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值