Steps for building the Tensorflow Environment

Source: Internet
Author: User

Steps for building the Tensorflow Environment

What?

We need to build the TensorFlow environment through the vmwarevirtual Machine Platform + Ubuntu Virtual Machine + pip installation.

For more information about other operating systems, see the link provided above.

Tip: it is best not to use windows. There will be many compatibility problems later.

There are also several installation methods, such as pip, docker, and anacdnda. Because ubuntu comes with Python and pip, the installation method of pip is provided here.

Determine the version of python and pip

Run the python-V command to confirm the python version. The python version must be 2.7 or 3.3 +.

Enter the command pip-V or pip3-V to confirm the pip version. We recommend that you set pip to 8.1 or above, or set pip3, if not, use sudo apt-get install python-pip python-dev for updates.

Why?

Currently, TensorFlow is installed in three ways:

(1) Docker: A virtualization technology that encapsulates the entire TensorFlow dependency and supports most operating systems (including windows). However, Docker (2018.1.21) is not complete yet, it is not recommended.

(2) pip: A Tool for installing and managing Python. It can be installed and packaged with pip, but only supports untu. This method is currently the mainstream method.

(3) Compile and install from source code: Compile the source code of TensorFlow into the pip installation package. This method -- I won't.

Therefore, we need to install pip on the vmwarevm Platform + Ubuntu VM +

How?

1. Download and install VMware, which is very simple. If you need verification, you can find the serial number online and use it for free.

2. Download the iso file of the Ubuntu open-source system, create a new virtual machine on VMware, load the ios file, and install Ubuntu.

You are required to enter a password when creating the Operating System. This password will be used to log on and obtain root permissions. Remember it!

3. Start the VM normally (in this case, you can select a physical drive to connect without iso), right-click to open the Super Terminal

Enter $ sudo apt-get install python-pip python-dev, enter the password, and then enter Y to download and install pip.

Enter $ sudo pip install -- upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl to download and install TensorFlow.

If you are prompted that your pip version is too low, enter $ pip install -- upgrade pip to upgrade pip, and then enter the command to download TensorFlow.

Verify that tensorflow is successfully installed

Start the terminal and enter python

Enter the following code:

>>> import tensorflow as tf>>> hello = tf.constant('Hello, TensorFlow!')>>> sess = tf.Session()>>> print(sess.run(hello))

If the output is Hello, TensorFlow! The installation is successful.

At this point, the TensorFlow environment is basically ready. Run $ python to enter the python environment and start TensorFlow! I hope it will be helpful for everyone's learning, and I hope you can support the house of helping customers more.

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.