机器学习(1)——环境安装

先尝试尝试tensorflow

1. 修改/etc/hosts/ 加入如下行

#TensorFlow start 
64.233.188.121 www.tensorflow.org 

#TensorFlow end

2. 进入官网后有这些选项

  • Pip install: Install TensorFlow on your machine, possibly upgrading previously installed Python packages. May impact existing Python programs on your machine.
  • Virtualenv install: Install TensorFlow in its own directory, not impacting any existing Python programs on your machine.
  • Anaconda install: Install TensorFlow in its own environment for those running the Anaconda Python distribution. Does not impact existing Python programs on your machine.
  • Docker install: Run TensorFlow in a Docker container isolated from all other programs on your machine.
  • Installing from sources: Install TensorFlow by building a pip wheel that you then install using pip.


  选择Anaconda install

3. Anaconda 安装

进入清华镜像 https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

进入下载页面 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

选择下载 Anaconda2-5.1.0-Linux-x86_64.sh

在控制台上进入下载后的文件目录, 默认~/Downloads/ 之下

执行 chmod +x Anaconda2-5.1.0-Linux-x86_64.sh  

执行 

./Anaconda2-5.1.0-Linux-x86_64.sh 

加入conda源

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

3. 安装tensorflow

创建tensorflow虚拟环境

conda create -n tensorflow python=2.7

因为要使用GPU,使用PIP进行安装

$ source activate tensorflow
(tensorflow)$  # Your prompt should change

设定Binary安装路径

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7
# Requires CUDA toolkit 8.0 and CuDNN v5. For other versions, see "Installing from sources" below.
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.0rc1-cp27-none-linux_x86_64.whl


安装 test flow

# Python 2
(tensorflow)$ pip install --ignore-installed --upgrade $TF_BINARY_URL


3. 激活GPU Support

1. 安装GTX 1060的驱动

sudo apt-get install nvidia-current-updates 
sudo nvidia-xconfig
sudo reboot


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值