Mac Tensorflow Library Wasn't Compiled To Use

  1. Mac Tensorflow Library Wasn't Compiled To Use File
  2. Mac Tensorflow Library Wasn't Compiled To Use Windows 10

These instructions were inspired by Mistobaan's gist, ageitgey's gist, and mattiasarro's tutorial.

Mac Tensorflow Library Wasn't Compiled To Use File

Background

Jun 13, 2017 Installing TensorFlow on Mac OX X with GPU support. Iwatobipen programming chemoinfo, programming, python, RDKit. Yesterday, I tried to install tensorflow-gpu on my mac. The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. Feb 20, 2017  When I am running tensorflow code, it prompts that The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.I have installed tensorflow using pip and don't. For this discussion, the most important command to know is pip install and pip3 install.But keep in mind that pip/pip3 can perform many other operations. If you execute a TensorFlow application using a precompiled package, you may receive messages like “The TensorFlow library wasn’t compiled to use XYZ instructions, but these are available on your machine and could speed up CPU. このまま1時間程度待てば、ビルドが完了する。 尚、このときSurface Pro本体が非常に高温になった 時間がかかることも併せて、膝の上などで実行するのはお勧めできない。.

I always encountered the following warnings when running my scripts using the precompiled TensorFlow Python package:

Oct 16, 2019  Photos makes it simple to get that content off your desktop and iPhone and into Photos on the Mac and in the cloud. Once you've finished the initial setup process, you can get started by uploading your pictures and videos or by taking a tour. Where are the photos I imported into Photos on my Mac? By default, the photos and videos you import into Photos are stored in the Photos library in the Pictures folder on your Mac. When you first use Photos, you create a new library or select the library that you want to use. This library automatically becomes your System Photo Library. How to get into photos mac library Jan 12, 2020  It's not clear why Apple decided to hide the user's Library folder, but you have multiple ways to get it back: two Apple provides (depending on the version of OS X you are using) and one in the underlying file system. The method you use depends on whether you want permanent access to the Library folder or only when you need to go there. Jan 13, 2020  On your Mac, your photo collection is separated into four main categories: Years, Months, Days, and All Photos. The All Photos tab shows all your photos and videos in chronological order. In Years, Months, and Days, you'll find your photos and videos grouped together based on.

I realized I can make these warnings go away by compiling from source, in addition to improve training speed. It was not as easy and straightforward as I thought, but I finally succeeded in creating a working build. Here I outline the steps I took, in the hopes it may benefit those who have encountered similar challenges.

Jul 09, 2018 TensorFlow also works on iOS — albeit with some limitations. To use the model, you give it new inputs, and it calculates outputs: this is called inferencing. Inference still requires a lot of. Feb 20, 2017 When I am running tensorflow code, it prompts that The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.I have installed tensorflow using pip and don't know how to deal with that. Any one can help with me? Jun 28, 2017  Installing Tensorflow and Anaconda Python: Deep Learning ENV. June 28, 2017 July 8, 2017 by rockash93. For example on my Mac it looks like –. The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. 2017-06-28 21:79: W tensorflow/core.

Machine setup

Hardware

  • Model: MacBook Pro (Retina, 15-inch, Mid 2014)
  • Processor: 2.5 GHz Intel Core i7
  • Memory: 16 GB 1600 MHz DDR3
  • Graphics: Intel Iris Pro 1536 MB RAM + NVIDIA GeForce GT 750M 2048 MB RAM

Software

  • OS: macOS Sierra 10.12.6
  • TensorFlow version: 1.3.1
  • Python version: 3.6.2 (conda)
  • Bazel version: 0.6.0-homebrew
  • CUDA/cuDNN version: 8.0/6.0

Prerequisites

macOS Sierra (10.12)

I tested on macOS Sierra 10.12. It may also work on Yosemite (10.10) and El Capitan (10.11), but I have not verified.

Xcode Command-Line Tools

I successfully compiled using Xcode 8.2.1 (Refer to http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html#system-requirements).

Disable SIP (System Integrity Protection) on Mac

For some reason I had to disable SIP in order for bazel build to build the TensorFlow pip package successfully. For security reasons, remember to re-enable SIP after your build.

Steps

Note: Many steps were based on https://www.tensorflow.org/install/install_sources ; I just happened to have a slightly different order that worked out for me.

  • Install homebrew
  • Install bazel
  • Install conda (I wanted a Python environment that will not mess with system Python. I downloaded Miniconda for Python 2.7 and intended to create a Python 3.6 environment)
  • Create and activate Python 3.6 environmentAlternatively, you can do:
  • Verify that the following packages are installed:
    • six
    • numpy
    • has to be at least 1.13 so you don't get a ModuleNotFoundError: No module named 'numpy.lib.mixins' error later on during bazel build
    • wheel
  • Install CUDA support prerequisites
    • Install GNU coreutils and swig
    • Refer to this for more detailed CUDA installation instructions.
    • Install CUDA Toolkit 8.0
    • Install cudNN 6.0
    • Set environment variable DYLD_LIBRARY_PATH
  • Clone the TensorFlow repository (instructions): be sure to checkout the r1.3 release
  • Configure the installationMy configure settings (Enter N for CUDA support if you do not want CUDA support or do not have a NVIDIA GPU):
  • Comment out linkopts = ['-lgomp'], (line 112) in tensorflow/third_party/gpus/cuda/BUILD.tpl (Refer to https://medium.com/@mattias.arro/installing-tensorflow-1-2-from-sources-with-gpu-support-on-macos-4f2c5cab8186)
  • Build the pip package (reference: https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions). It took around 35 minutes on my MacBook Pro.
  • Refer to https://github.com/tensorflow/tensorflow/issues/6729 if you run into any other problems
  • Build the wheel (.whl) file
  • Install the pip package
  • Validate your installation (instructions)
    • Change directory to any directory on your system other than the tensorflow subdirectory from which you ran ./configure
    • Invoke python interactive shell
    • Type in the following scriptIf you have a supported NVIDIA CUDA GPU, the script should run without a problem and display something similar to this:
Library

Have fun training your models!

Google provides two methods for installing TensorFlow, and the simpler option involves installing precompiled packages. This discussion presents a three-step process for installing these packages:

  1. Install Python on your development system.
  2. Install the pip package manager.
  3. Use pip to install TensorFlow.

The second installation method involves compiling TensorFlow from its source code. This option takes time and effort, but you can obtain better performance because your TensorFlow package will take the fullest advantage of your processor’s capabilities.

Install Python and pip/pip3

TensorFlow supports development with Java and C++, but this discussion focuses on Python. Python 3 is used in the example code, but you’re welcome to use Python 2.

Python’s official package manager is pip, which is a recursive acronym that stands for “pip installs Python.” To install packages like TensorFlow, you can use pip on Python 2 systems or pip3 on Python 3 systems. Package management commands have the following format:

pip and pip3 accept similar commands and perform similar operations. For example, executing pip list or pip3 list prints all the Python packages installed on your system. The table lists this and five other commands.

Package Management Commands

Command NameDescription
installInstalls a specified package
uninstallUninstalls a specified package
downloadDownloads a package, but doesn’t install it
listLists installed packages
showPrints information about a specified package
searchSearches for a package whose name or summary contains the given text

For this discussion, the most important command to know is pip install and pip3 install. But keep in mind that pip/pip3 can perform many other operations.

If you execute a TensorFlow application using a precompiled package, you may receive messages like “The TensorFlow library wasn’t compiled to use XYZ instructions, but these are available on your machine and could speed up CPU computations.” To turn off these messages, create an environment variable named TF_CPP_MIN_LOG_LEVEL and set its value to 3.

Installing on Mac OS

Many versions of Mac OS have Python already installed, but you should obtain and install a new Python package. If you visit Python Software Foundation, you see one button for Python 2 and another for Python 3. If you click one of these buttons, your browser downloads a PKG file that serves as the Python installer.

When you launch the installer, the Python installation dialog box appears. To install the package, follow these five steps:

  1. In the Introduction page, click the button labeled Continue.
  2. In the Read Me page, click the button labeled Continue.
  3. In the License page, click the button labeled Continue and then click Agree to accept the software license agreement.
  4. In the Installation Type page, click Install to begin the installation process, entering your password, if necessary.
  5. When the installation is complete, click Close to close the dialog box.

If the installation completes successfully, you can run pip or pip3 on a command line. You can install TensorFlow with the following command:

This command tells the package manager to download TensorFlow, TensorBoard, and a series of dependencies. One dependency is six, which supports compatibility between Python 2 and 3. If the installation fails due to a preinstalled six package, you can fix the issue by executing the following command:

This command tells pip to install six on top of the existing installation. After this installation completes, you should be able to run pip install tensorflow without error. On the system used here, the installer stores the TensorFlow files in the /Library/Frameworks/Python.framework/Versions/<ver>/lib/python<ver>/site-packages/tensorflow directory.

Installing on Linux

Many popular distributions of Linux are based on Debian, including Ubuntu and Linux Mint. These distributions rely on the Advanced Package Tool (APT) to manage packages, which you can access on the command line by entering apt-get. This discussion explains how to install TensorFlow on these and similar operating systems.

Most Linux distributions already have Python installed, but it’s a good idea to install the full development version and pip/pip3. The following command installs both for Python 2:

Alternatively, the following command performs the installation for Python 3:

Compiled

After installation completes, you should be able to execute pip or pip3 on the command line. The following command installs the TensorFlow package and its dependencies (use pip3 for Python 3):

This command installs TensorFlow, TensorBoard, and their dependencies. On an Ubuntu system, the installer stores the files in the /usr/local/lib/python<ver>/dist-packages/tensorflow directory.

Installing on Windows

For Windows users, TensorFlow’s documentation specifically recommends installing a 64-bit version of Python 3.5. To download the installer, visit Python Software Foundation, find a version of Python 3, and click the link entitled Windows x86-64 executable installer. This downloads an *.exe file that serves as the installer.

When you launch the installer, the Python setup dialog box appears. The following steps install Python on your system:

  1. Check the checkbox for adding the Python installation directory to the PATH variable.
  2. Click the link labeled Install Now.
  3. When installation finishes, click the Close button to close the installer.

After you install Python, you should be able to run pip3 on a command line. You can install TensorFlow with the following command:

Mac Tensorflow Library Wasn't Compiled To Use Windows 10

The package manager downloads TensorFlow, TensorBoard, and the packages’ dependencies. On my Windows system, the installer stores the files to the C:Users<name>AppDataLocalProgramsPythonPython<ver>Libsite-packagestensorflow directory.