cmake build tensorflow v1.4.0
- OS : Ubuntu 20.04/Ubuntu 18.04/Ubuntu 16.04
- local_third_party:
tensorflow/tensorflow/contrib/cmake/third_party
-
only for tensorflow v1.4.0
-
delete all xx/.git
>>sudo apt update
>>sudo apt install gcc g++ cmake git python-dev python-pip python-numpy swig
>>git clone https://github.com/jnulzl/tf_cmake_build_v1.4
>>cd tf_cmake_build_v1.4
>>mkdir build_ubuntu2004 && cd build_ubuntu2004 # build_ubuntu1804,build_ubuntu1604
>>cmake ../tensorflow/contrib/cmake -DCMAKE_BUILD_TYPE=Release -Dtensorflow_BUILD_SHARED_LIB=ON -Dtensorflow_VERBOSE=ON -Dtensorflow_USE_LOCAL_THIRD_PARTY=ON
>>make VERBOSE=1 -j4
....
make[2]: Leaving directory '/mnt/data/jnulzl/codes/tensorflow/build_ubuntu2004'
[100%] Built target pywrap_tensorflow_internal
make[1]: Leaving directory '/mnt/data/jnulzl/codes/tensorflow/build_ubuntu2004'
/usr/bin/cmake -E cmake_progress_start /mnt/data/jnulzl/codes/tensorflow/build_ubuntu2004/CMakeFiles 0
>>ls lib*so
libpywrap_tensorflow_internal.so libtensorflow.so
Linux CPU |
Linux GPU |
Mac OS CPU |
Windows CPU |
Android |
---|---|---|---|---|
TensorFlow is an open source software library for numerical computation using data flow graphs. The graph nodes represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) that flow between them. This flexible architecture lets you deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device without rewriting code. TensorFlow also includes TensorBoard, a data visualization toolkit.
TensorFlow was originally developed by researchers and engineers working on the Google Brain team within Google's Machine Intelligence Research organization for the purposes of conducting machine learning and deep neural networks research. The system is general enough to be applicable in a wide variety of other domains, as well.
If you want to contribute to TensorFlow, be sure to review the contribution guidelines. This project adheres to TensorFlow's code of conduct. By participating, you are expected to uphold this code.
We use GitHub issues for tracking requests and bugs. So please see TensorFlow Discuss for general questions and discussion, and please direct specific questions to Stack Overflow.
See Installing TensorFlow for instructions on how to install our release binaries or how to build from source.
People who are a little more adventurous can also try our nightly binaries:
Nightly pip packages
- We are pleased to announce that TensorFlow now offers nightly pip packages
under the tf-nightly project on pypi.
Simply run
pip install tf-nightly
in a clean environment to install the nightly tensorflow build. We currently only support CPU packages on Linux, Mac, and Windows. GPU packages on all platforms will arrive soon!
Individual whl files
- Linux CPU-only: Python 2 (build history) / Python 3.4 (build history) / Python 3.5 (build history)
- Linux GPU: Python 2 (build history) / Python 3.4 (build history) / Python 3.5 (build history)
- Mac CPU-only: Python 2 (build history) / Python 3 (build history)
- Windows CPU-only: Python 3.5 64-bit (build history) / Python 3.6 64-bit (build history)
- Windows GPU: Python 3.5 64-bit (build history) / Python 3.6 64-bit (build history)
- Android: demo APK, native libs (build history)
$ python
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> sess.run(hello)
'Hello, TensorFlow!'
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> sess.run(a + b)
42
>>> sess.close()
- TensorFlow website
- TensorFlow White Papers
- TensorFlow Model Zoo
- TensorFlow MOOC on Udacity
- TensorFlow course at Stanford
Learn more about the TensorFlow community at the community page of tensorflow.org for a few ways to participate.