微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Ubuntu 14.04 + Tensorflow 1.0

1. 创建一个 conda 环境

conda create -n tf python=2.7 或者 conda create -n tf python=3.4

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

source activate tf
cpu版本:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-cp27-none-linux_x86_64.whl

GPU版本:
wget https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
sudo pip install tensorflow-0.9.0-cp27-none-linux_x86_64.whl

3.测试

import tensorflow as tf
hello = 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 htop

watch -n 1 nvidia-smi

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

原文地址:https://www.jb51.cc/ubuntu/354112.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐