Ubuntu 14.04 + Tensorflow 1.0

来源:互联网 发布:python两个数组相减 编辑:程序博客网 时间:2024/05/20 19:49

1. 创建一个 conda 环境

conda create -n tf python=2.7或者conda create -n tensorflow python=3.5.2 

2. 激活这个conda环境并在里面安装TensorFlow

source activate tfCPU版本:pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-cp27-none-linux_x86_64.whlpip install --ignore-installed --upgrade  https://ci.tensorflow.org/view/Nightly/job/nightly-python35-linux-cpu/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.1.0rc2-cp35-cp35m-linux_x86_64.whlGPU版本:wget https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whlsudo pip install tensorflow-0.9.0-cp27-none-linux_x86_64.whlconda安装方式:conda install -c conda-forge tensorflow

3.测试

import tensorflow as tfhello = tf.constant('Hello, TensorFlow!')sess = tf.Session()sess.run(hello)a = tf.constant(10)b = tf.constant(32)sess.run(a+b)

4.其他

  1. gpu版本
  2. ubuntu下查看CPU/GPU/内存使用率
sudo apt-get install htopwatch -n 1 nvidia-smi


5.TensorFlow-Tutorials

https://github.com/Hvass-Labs/TensorFlow-Tutorials
conda create –name tf python=3
source activate tf
pip install -r requirements.txt (修改cpu or gpu版本)


Reference

  1. Ubuntu 14.04 64位安装 Google 的 Tensorflow
  2. Ubuntu下如何安装TensorFlow
  3. 调用tf.softmax_cross_entropy_with_logits函数出错解决
  4. ubuntu下查看CPU/GPU/内存使用率

Tensorflow

https://github.com/tensorflow/tensorflow

0 0