美文网首页我爱编程程序员
Centos下安装Anaconda及tensorflow

Centos下安装Anaconda及tensorflow

作者: 嗯我是一个胖子 | 来源:发表于2016-11-29 15:54 被阅读0次

    Anaconda安装

    • 官方下载链接 下载对应版本的Anaconda
    • cd /home/***/software #进入到软件所在目录
    • bash Anaconda2-4.2.0-Linux-x86_64.sh 进行安装 一路回车即可
    • 修改Anaconda 更新源 国内镜像加速(默认国外经常连接不上报错)
    conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
    conda config --set show_channel_urls yes
    
    • 关闭SSH打开新的connection

    Tensorflow安装

    • 创建conda环境
    conda create -n tensorflow python=2.7
    source activate tensorflow
    pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
    
    • 测试是否安装成功 进入python环境
    import tensorflow as tf
    hello=tf.constant('hello,Tensorflow')
    sess=tf.Session()
    print sess.run(hello)
    --输出 hello,Tensorflow表明成功--
    
    • 退出tensorflow环境
    source deactivate
    

    Jupyter安装

    • 安装好anaconda是默认自带jupyter notebook的,但是由于tensorflow是安装在conda新构建的环境变量下,因此就需要重新对jupyter进行安装
    source activate tensorflow
    conda install ipython
    conda install -n tensorflow -y jupyter 
    jupyter notebook --ip 9.*.*.* --port 8888
    
    • 在浏览器中输入对应的ip和端口,选择如下图所示的红框控制台


    • 远程访问设置

    相关文章

      网友评论

        本文标题:Centos下安装Anaconda及tensorflow

        本文链接:https://www.haomeiwen.com/subject/rrmapttx.html