zoukankan      html  css  js  c++  java
  • Ubuntu下安装Anaconda和tensorflow

    官方指南:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/docs_src/install/install_linux.md#InstallingAnaconda
    https://github.com/jtoy/awesome-tensorflow
    1.在清华大学 TUNA 镜像源选择对应的操作系统与所需的Python版本下载Anaconda安装包。  
     bash Anaconda3-5.0.1-Linux-x86_64.sh

    在安装的过程中,会询问安装路径,按回车即可。之后会询问是否将Anaconda安装路径加入到环境变量(.bashrc)中,输入yes,这样以后在终端中输入python即可直接进入Anaconda的Python版本(如果你的系统中之前安装过Python,自行选择yes or no)。安装成功后,会有当前用户根目录下生成一个anaconda3的文件夹,里面就是安装好的内容

    查询安装信息 $ conda info

    查询当前已经安装的库 $conda list

    安装库(***代表库名称)$conda install ***

    更新库$conda update ***

    2. 添加清华大学 TUNA提供的Anaconda仓库镜像

    $ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

    $ conda config --set show_channel_urls yes

    之后会自动在用户根目录生成“.condarc”文件,Ubuntu环境下路径为~/.condarc,Windows环境下路径为C:用户your_user_name.condarc

    3.安装

    创建环境:$conda create -n tensorflow 
    激活:$source activate tensorflow
    搜索当前可用的tensorflow版本:$ anaconda search -t conda tensorflow

    $anaconda show anaconda/tensorflow

    $conda install --channel https://conda.anaconda.org/anaconda tensorflow

       或者conda install -c anaconda tensorflow

    测试:

    import tensorflow as tf
    hello = tf.constant('Hello, TensorFlow!')
    sess = tf.Session()
    print(sess.run(hello))

    关闭: $source deactivate tensorflow

    注:若出现类似The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations这样的warning,可以通过在终端中输入export TF_CPP_MIN_LOG_LEVEL=2解决

  • 相关阅读:
    Windbg使用
    C#与C++之间类型的对应
    Hook CreateProcess
    基于EasyHook实现监控explorer资源管理器文件复制、删除、剪切等操作
    GUID和UUID、CLSID、IID 区别及联系
    hook C++
    EasyHook Creating a remote file monitor
    hook工具
    EasyHook
    Hook exe 和 file
  • 原文地址:https://www.cnblogs.com/medsci/p/8041602.html
Copyright © 2011-2022 走看看