Ubuntu Installation TensorFlow

Source: Internet
Author: User
Tags cuda toolkit

1. Install Pip

sudo Install Python-pip Python-dev

2. Installing TensorFlow for Python 2.7

# Ubuntu/linux --bit, CPU only, Python2.7:$ sudoPipInstall--upgrade https://STORAGE.GOOGLEAPIS.COM/TENSORFLOW/LINUX/CPU/TENSORFLOW-0.8.0-CP27-NONE-LINUX_X86_64.WHL# Ubuntu/linux --bit, GPU enabled, Python2.7. Requires CUDA Toolkit7.5and CuDNN v4.# for other versions, see"Install from sources"below.$sudoPipInstall--upgrade https://STORAGE.GOOGLEAPIS.COM/TENSORFLOW/LINUX/GPU/TENSORFLOW-0.8.0-CP27-NONE-LINUX_X86_64.WHL# Mac OS X, CPU only:$sudoEasy_install--Upgrade six$sudoPipInstall--upgrade https://STORAGE.GOOGLEAPIS.COM/TENSORFLOW/MAC/TENSORFLOW-0.8.0-PY2-NONE-ANY.WHL

3. Installing TensorFlow for Python 3.4

# Ubuntu/linux --bit, CPU only, Python3.4:$ sudoPip3Install--upgrade https://STORAGE.GOOGLEAPIS.COM/TENSORFLOW/LINUX/CPU/TENSORFLOW-0.8.0-CP34-CP34M-LINUX_X86_64.WHL# Ubuntu/linux --bit, GPU enabled, Python3.4. Requires CUDA Toolkit7.5and CuDNN v4.# for other versions, see"Install from sources"below.$sudoPip3Install--upgrade https://STORAGE.GOOGLEAPIS.COM/TENSORFLOW/LINUX/GPU/TENSORFLOW-0.8.0-CP34-CP34M-LINUX_X86_64.WHL# Mac OS X, CPU only:$sudoEasy_install--Upgrade six$sudoPip3Install--upgrade https://STORAGE.GOOGLEAPIS.COM/TENSORFLOW/MAC/TENSORFLOW-0.8.0-PY3-NONE-ANY.WHL

Note: If you have previously installed TensorFlow < 0.7.1 versions, you should first use pip uninstall uninstall TensorFlow and protobuf to ensure that you are getting an installation package with the latest protobuf dependencies.

4. Test whether the installation is successful

$ python ... >>> import TensorFlow as tf>>> hello = tf.constant ('Hello, tensorflow! ' )>>> sess = TF. Session ()>>> print (Sess.run (hello)) Hello, TensorFlow!>>> a = tf.constant (10  )>>> b = tf.constant (+)>>> print (Sess.run (A + b))  >>>

Ubuntu Installation TensorFlow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.