Tensorflow Library For Mac

Jul 24, 2019  @smitshilu, this was a huge inspiration, thank you.I couldn't pull it off, so I've been working on it for the past week. I finally succeeded on Mac. Tensorflow r1.5.

This package provides inference bindings for Tensorflow and H2O.ai.The module directory contains a pretrained set of ready to use models.

Prerequisites

  • bazel
  • swig
  • python
  • maven

Install Bazel 0.4.5 or later

For Linux:

Install SWIG

For Linux:

For Mac:

Install Maven

For Linux:

Tensorflow

For Mac:

Build the Tensorflow native java library and the Tensorflow H2O bindings

From the main project directory run ./gradlew clean tensorflowCompile to build the so and jar TensorFlow files. This can take several minutes.

Go back to the top-level directory of the deepwater repo, and follow the directions there.

Tensorflow Library For Mac Os

TensorFlowSharp are bindings to the native TensorFlow library.

You can either use the TensorFlow C-library release binaries, or buildyour own from source. Here are some pre-built TensorFlow binaries youcan use for each platform:

  • Linux
    • CPU-only: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.1.0.tar.gz
    • GPU-enabled: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-1.1.0.tar.gz
  • Mac: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-darwin-x86_64-1.1.0.tar.gz
  • Windows: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-1.2.0-rc0.zip

Unpack the above .tar.gz suitable for your system on a prefix that yoursystem's dynamic linker can use, for example, go to /usr/local and unpack there.

Mac note: the package contains a .so file, you will need to rename this to .dylib forit to work.

Tensorflow Library For Mac Windows 10

Once you do that, you need to open the solution file on the toplevel directory and build. This will produce both the TensorFlowSharplibrary as well as compile the tests and samples.

Building your own native TensorFlow library

You will wan to use Visual Studio 2017 or Visual Studio for Mac to build.

Library

To build the TensorFlow C library from source,follow these instructions.

Tensorflow Library For Mac Download

This includes checking out the Tensorflow sources, installing Bazel,and building the core.

Once you do that, you will need to build the shared library.First, in the tensorflow directory, run:

and answer the various prompts about your build. Important:building with CUDA support provides better runtime performancebut has additional dependencies as discussed in the Tensorflowinstallation Web page.

Once configured, run:

If you want debug symbols for Tensorflow, while debugging the binding:

You will need the generated library (libtensorflow.so) to be installed in asystem accessible location like /usr/local/lib

On Linux:

On MacOS:

Running the test

Tensorflow Library For Mac 2017

I am currently using Visual Studio for Mac to do the development, but thisshould work on Windows with VS and Linux with MonoDevelop.

Before the solution will run you will need the shared library generated tobe on a location accessibly by the Mono runtime (for example /usr/local/lib).

While Tensorflow builds a library with the extension .so, you will needto make sure that it has the proper name for your platform (tensorflow.dll on Windows,tensorflow.dylib on Mac) and copy that there.

Tensorflow is a 64-bit library, so you will need to use a 64-bit Mono to run,at home (where I am doing this work), I have a copy of 64-bit Mono on /mono,so you will want to set that in your project configuration, to do this:

Tensorflow Library For Mac Download

Ensure that your Build/Compiler settings set 'Platform Target' to 'x64'.

Open the solution file in the top directory, and when you hit run, this willrun the API test.