The Tensorflow Library Wasn't Compiled To Use Sse4.1 Instructions Mac

  1. The Tensorflow Library Wasn't Compiled To Use Sse4.1 Instructions Machine
  2. The Tensorflow Library Wasn't Compiled To Use Sse4.1 Instructions Mac And Cheese
  3. The Tensorflow Library Wasn't Compiled To Use Sse4.1 Instructions Mac Youtube
  4. The Tensorflow Library Wasn't Compiled To Use Sse4.1 Instructions Mac 2016

Dec 21, 2017  Hi, This is on Ubuntu 16.04 LTS on a BDW-E machine. I am using Anaconda to switch to the IDP distributed packages. When calling TF, both the Ubuntu distro (expected), but also the IDP channel report the following runtime warnings. Jun 15, 2018  tl;dr: Yes. I got 40% faster CPU-only training on a small CNN by building TensorFlow from source to use SSE/AVX/FMA instructions. Look at some example build flags. MNIST is the.

The Tensorflow Library Wasn

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

Background

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

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.

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

The Tensorflow Library Wasn't Compiled To Use Sse4.1 Instructions Machine

  • 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

The Tensorflow Library Wasn't Compiled To Use Sse4.1 Instructions Mac And Cheese

Youtube

The Tensorflow Library Wasn't Compiled To Use Sse4.1 Instructions Mac Youtube

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.

The Tensorflow Library Wasn't Compiled To Use Sse4.1 Instructions Mac 2016

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:

Have fun training your models! How to clear your photos library on mac.