References:
- https://www.tensorflow.org/install/install_sources#ConfigureInstallation
- https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions#comment81255824_47146118
- Pre-built wheels: https://github.com/lakshayg/tensorflow-build
- More pre-built wheels: https://github.com/yaroslavvb/tensorflow-community-wheels
- https://stackoverflow.com/questions/40373686/freeze-graph-py-throws-an-error-during-build/40374431#40374431
- https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions
Environment:
- Ubuntu 16.04.3 GNOME (https://wiki.ubuntu.com/UbuntuGNOME/GetUbuntuGNOME)
- Anaconda 5.01 - Python 3.6 - (https://www.anaconda.com/download/#linux)
Software Set Up:
- Install Anaconda: https://docs.anaconda.com/anaconda/install/linux
- Install git
sudo apt-get install git-core
- Create a virtualenv
conda create -n tensorflow python=3.6
- Activate virtualenv
activate source tensorflow
- Install TensorFlow requirements
a.conda install six numpy wheel
- Install Bazel https://docs.bazel.build/versions/master/install.html#mac-os-x
- Clone TensorFlow repository:
git clone https://github.com/tensorflow/tensorflow
a. Choose the branchgit checkout r1.4
<-- There seems to be a problem with r1.4 during the build process. Ended up using the master branch as of Nov 16, 2017git checkout master
- Determine python binary location
which python
Sample output:/home/ronson/anaconda3/envs/tensorflow/bin/python
- Start build process for TensorFlow
a.cd tensorflow
b../configure
c./home/ronson/anaconda3/envs/tensorflow/lib/python3.6/site-packages
d.bazel build --copt=-march=native --config="opt,MKL" -k //tensorflow/tools/pip_package:build_pip_package --local_resources 4096,.5,1.0 --verbose_failures
e. Create the wheel./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
f. This was the wheel that I created:pip install /tmp/tensorflow_pkg/tensorflow-1.4.0-cp36-cp36m-linux_x86_64.whl
Object Detection Installation
Run Object Detection Python Notebook
- Set up Kernel for virtualenv
a. http://help.pythonanywhere.com/pages/IPythonNotebookVirtualenvs - Change to the research folder
cd /home/ronson/models/research
- Run jupyter notebook
jupyter notebook
- Open the
object_detection_tutorial.ipynb
in./models/research/object_detection
- Change the kernel: Kernel -> Change Kernel -> tensorflow
- As of Nov 11, 2017, the default MODEL_NAME in the notebook doesn't work
https://github.com/tensorflow/models/issues/2773
a. Change the MODEL__NAME tossd_mobilenet_v1_coco_11_06_2017