Code Monkey home page Code Monkey logo

asdlei99 / tensorflow-cmake Goto Github PK

View Code? Open in Web Editor NEW

This project forked from loseall/tensorflow-cmake

0.0 2.0 0.0 28.13 MB

tensorflow build by CMake

License: Apache License 2.0

Python 41.29% CMake 0.40% C 0.33% C++ 47.58% Batchfile 0.01% Shell 0.48% LLVM 0.01% Java 0.85% Jupyter Notebook 2.65% Makefile 0.06% Objective-C 0.02% Objective-C++ 0.11% Ruby 0.01% PHP 0.01% PureBasic 0.03% Dockerfile 0.01% HTML 4.95% Go 1.23% Perl 0.01% Smarty 0.01%

tensorflow-cmake's Introduction

NOTICE

The original tensorflow readme.

TensorFlow CMake for Windows

Because beyond tensorflow r1.11, tensorflow officially drop CMake build files, and support only bazel, so I personally try to maintain a cmake build scripts for tensorflow.

Environment

The following lists prerequisite softwares and libraries:

  • python3 (v3.6 in Anaconda is recommended)
  • cmake >= 3.12
  • git
  • cuda == 9.0
  • cudnn == 7.0

The following lists prerequisite pip packages:

  • absl-py >= 0.2.2
  • protobuf >= 3.6.0
  • numpy**
  • six
  • setuptools
  • wheel

Compilers (tested by me):

  • VS 2015 (vc14), or
  • VS 2017 (vc15)***

*Swig is pre-downloaded into ./_build

**You should the same version of numpy in BUILD and USE

***When you use the newest VS 2017, CUDA compile check may fail, to resolve this, see here

How to compile

Start into VS x64 prompt.

====================

> mkdir _build && cd _build
> cmake .. -A x64 -T host=x64 ^
  -DCMAKE_BUILD_TYPE=Release ^
  -DPYTHON_EXECUTABLE=%PYTHON_EXECUTABLE% ^
  -DPYTHON_LIBRARIES=%PYTHON_LIB% ^
  -Dtensorflow_ENABLE_GPU=<ON/OFF> ^
  -Dtensorflow_BUILD_SHARED_LIB=<ON/OFF> ^
  -Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:AVX2 ^
  -Dtensorflow_ENABLE_MKL_SUPPORT=<ON/OFF> ^
  -Dtensorflow_ENABLE_MKLDNN_SUPPORT=<ON/OFF> ^
  -Dtensorflow_BUILD_PYTHON_BINDINGS=<ON/OFF> ^
  -Dtensorflow_DISABLE_EIGEN_FORCEINLINE=<ON/OFF> ^
  -Dtensorflow_ENABLE_GRPC_SUPPORT=ON ^
  -Dtensorflow_ENABLE_SSL_SUPPORT=<ON/OFF> ^
  -Dtensorflow_ENABLE_SNAPPY_SUPPORT=<ON/OFF>
> cmake --build . --config Release --target tf_python_build_pip_package

Note: ^ is another line, GRPC must set ON, WIN_CPU_SIMD_OPTIONS can set to OFF if you don't know what's AVX. PYTHON_EXECUTABLE and PYTHON_LIB should specify to your own path.(Path to python.exe and python36.lib for instance)

OR your can try experimentally script make.bat to auto search required path

> make && cd _build
> cmake --build . --config Release --target tf_python_build_pip_package

Before doing this, your must edit make.bat and your own options (such as GPU or MKL)

File Re-organized

The original cmake files are all in the ./tensorflow/contrib/cmake, it's better to add CMakeLists.txt to each sub-folders


THANKS TO ALL THE CONTRIBUTORS TO CMAKE SCRIPTS

tensorflow-cmake's People

Contributors

loseall avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.