TensorFlow GPU版本安装(3):Anoconda版本安装

一 安装

已经按照tensorflow的推荐安装cuda8.0和cudnn5.1插件,下载anaconda安装文件、tensorflow gpu版本和其他python插件。使用anaconda安装原因为其本身完美集成了绝大多数常用插件,减少了很多安装麻烦,同时其本身也完美兼容tensorflow,可以在不用更改服务器已安装python版本的情况下,快速安装tensorflow。

1.1 安装conda

Sudo bash .*sh

然后重启:reboot

[root@afmdb03sz ~]# which python

/root/anaconda2/bin/python

1.2 安装tensorflow

使用conda离线安装各种包

 

Conda install –offline *.tar.bz2

同时也可以使用pip命令安装非anaconda插件,比如github上的各种RBM实现。

使用本机原始python:/usr/bin/python

安装插件到原始python:/usr/bin/pip*

二 测试程序

>> import tensorflow as tf

>>> hello = tf.constant('Hello,TensorFlow!')

>>> sess = tf.Session()

2017-08-17 10:36:38.647864: W tensorflow/core/platform/cpu_feature_guard.cc:45]The TensorFlow library wasn't compiled to use SSE4.1 instructions, bu                                                                                       t these are available on your machine and could speed up CPUcomputations.

2017-08-17 10:36:38.647914: Wtensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn'tcompiled to use SSE4.2 instructions, bu                                                                                       t these are available onyour machine and could speed up CPU computations.

2017-08-17 10:36:38.647930: Wtensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn'tcompiled to use AVX instructions, but t                                                                                        heseare available on your machine and could speed up CPU computations.

2017-08-17 10:36:38.647943: Wtensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn'tcompiled to use AVX2 instructions, but                                                                                        these are available on your machine and could speed up CPU computations.

2017-08-17 10:36:38.647955: Wtensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn'tcompiled to use FMA instructions, but t                                                                                       hese are available on your machine and could speed up CPU computations.

2017-08-17 10:36:42.455199: Itensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found device 0 withproperties:

name: Tesla K40m

major: 3 minor: 5 memoryClockRate (GHz)0.745

pciBusID 0000:03:00.0

Total memory: 11.17GiB

Free memory: 11.10GiB

2017-08-17 10:36:42.455282: Itensorflow/core/common_runtime/gpu/gpu_device.cc:961] DMA: 0

2017-08-17 10:36:42.455301: Itensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0:   Y

2017-08-17 10:36:42.455331: Itensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Creating TensorFlowdevice (/gpu:0) -> (device: 0, name: Tesla K                                                                                       40m, pci bus id: 0000:03:00.0)

>>> sess.run(hello

... )

'Hello, TensorFlow!'

>>> a = tf.constant(10)

>>> b = tf.constant(32)

>>> sess.run(a + b)

42

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值