Use PIP to install TensorFlow under Ubuntu

Source: Internet
Author: User
Tags constant

The release of TensorFlow itself is based on Ubuntu, so it's more convenient under Ubuntu than under Windows. There are three kinds of installation methods, see TensorFlow the second chapter of the construction of the environment. This article describes using PIP to install CPU-based TensorFlow.
1, download install pip:$ sudo apt-get install Python-pip Python-dev
2, install TensorFlow

$ sudo pip install--upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_ X86_64.whl

An error occurred during installation:
1:sslerror:hostname ' storage.googleapis.com ' Dosen ' t match ' www.google.com '
Workaround: Open the link address, download the software and place it in the home directory, or download it with W-get. Then replace the above instruction link address with the name of the downloaded file.
2:oserror:[error13]permission deneied: ...
I forgot to add sudo when I installed it.
3,sslerror:the read operation time Out
Change command to: Pip--default-timeout=100 install #####

Test:

Import TensorFlow as tf
>>> hello = tf.constant (' Hello, tensorflow! ')
>>> sess = tf. Session ()
>>> sess.run (hello)
Hello, tensorflow!
>>> a = Tf.constant (ten)
>>> B = tf.constant (+)
>>> sess.run (a+b)
42

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.