TensorFlow Installation and Testing

Source: Internet
Author: User
Tags virtualenv

Official website: http://tensorflow.org/
Installation steps:
1, sudo apt-get install Python-pip python-dev python-virtualenv

2, virtualenv--system-site-packages ~/tensorflow

3. CD ~/tensorflow

4. Source Bin/activate # If using bash

5, (TensorFlow) $ pip Install TENSORFLOW-0.5.0-CP27-NONE-LINUX_X86_64.WHL

Test:

1. Open the terminal input CD TensorFlow

2. SOURCE Bin/activate

3. Python

4. Enter the following example after entering 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 (32)
>>> print Sess.run (a+b)
42
>>>

5, Test success next first quit Python press the shortcut key Ctrl+d

6. Then exit TensorFlow at the command Line Input command: Deactivate

TensorFlow Installation and Testing

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.