TensorFlow Getting Started: Mac installation TensorFlow

Source: Internet
Author: User
Tags virtualenv

Development environment: Mac OS 10.12.5Python 2.7.10GCC 4.2.1

Mac default is no pip, install PIP.

sudo easy_install pip

1. Installing virtualenv

sudo pip install virtualenv--upgrade

Create a working directory:

sudo virtualenv--system-site-packages ~/tensorflow

Make the directory, activate the sandbox

CD ~/tensorflow

SOURCE Bin/activate

Install TensorFlow in 2.virtualenv

After entering the sandbox, execute the following command to install TensorFlow:

(tensorflow) $ sudo pip install tensorflow==1.2.1

3. Running TensorFlow

...

Environment/users/***/tensorflow

Successfully installed BACKPORTS.WEAKREF-1.0RC1 bleach-1.5.0 funcsigs-1.0.2 html5lib-0.9999999 markdown-2.6.8 mock-2.0.0 numpy-1.13.0 pbr-3.1.1 protobuf-3.3.0 six-1.10.0 tensorflow-1.2.1 werkzeug-0.12.

Hello World tests:

$ Pythonpython 2.7.10 (default, Feb 7, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on Darwint Ype "Help", "copyright", "credits" or "license" for more information.>>> >>> import TensorFlow as tf> >> Hello =tf.constant (' Hello world! ') >>> sess = tf. Session () 2017-07-05 23:58:34.771619:w tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn ' T compiled to usage SSE4.2 instructions, but these is available on your machine and could speed up CPU computations.2017-07 -05 23:58:34.771654:w tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn ' t compiled to use AV X instructions, but these is available on your machine and could speed up CPU computations.2017-07-05 23:58:34.771663:w TENSORFLOW/CORE/PLATFORM/CPU_FEATURE_GUARD.CC:45] The TensorFlow library wasn ' t compiled to use AVX2 instructions, but th ESE is available on your machine and could speed up CPU computations.2017-07-05 23:58:34.771671:w tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn ' t compiled to use FMA instruct Ions, but these is available on your machine and could speed up CPU computations.>>> print sess.run (hello) Hello world!

Congratulations, TensorFlow installation was successful.

* Each time you run the TensorFlow program, you need to go to the TensorFlow directory and execute the source Bin/activate command to activate the sandbox.

*ubuntu/linux can also be prepared on Mac OS. The TensorFlow installation version is divided into CPU and GPU versions, with the following differences:

(tensorflow) $ sudo pip install tensorflow==1.2.1

(tensorflow) $ sudo pip install tensorflow-gpu==1.2.1

TensorFlow Getting Started: Mac 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.