1

I installed tensor flow on Intel NUC with pip3 pip3 install --upgrade tensor flow But got below error 2018-10-25 20:14:31.685641: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA cannot open X server

After googling found that i need to build tensor flow from source. So i installed bazel version - 0.18 Git clone tensor flow and checked out 1.12 version. Further used below commands: bazel build -c opt --copt=-mavx --copt=-msse4.1 --copt=-msse4.2 -k //tensorflow/tools/pip_package:build_pip_package

bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

pip3 install /tmp/tensorflow_pkg/NAME_OF_WHEEL.whl

and i got error tensorflow-1.12.0rc1-cp27-cp27mu-linux_x86_64.whl is not a supported wheel on this platform.

pip3 --version pip 9.0.3 from /usr/local/lib/python3.5/dist-packages (python 3.5)

sudo pip3 --version pip 9.0.3 from /usr/local/lib/python3.5/dist-packages (python 3.5)

How to solve this issue?

Neeraj Sharma
  • 174
  • 1
  • 3
  • 14
  • The wheel you built is for Python 2.7. It can not be installed for Python 3.5. – hoefling Oct 25 '18 at 08:05
  • You mean for CPU's having extension AVX and FMA have to build tensor flow with python2.7 – Neeraj Sharma Oct 25 '18 at 08:32
  • But in that case how it will work with python3.5 files. It successfully installed below packages with python2.7 Successfully installed absl-py-0.6.0 astor-0.7.1 backports.weakref-1.0.post1 enum34-1.1.6 funcsigs-1.0.2 futures-3.2.0 gast-0.2.0 grpcio-1.16.0 h5py-2.8.0 keras-applications-1.0.6 keras-preprocessing-1.0.5 markdown-3.0.1 mock-2.0.0 numpy-1.15.3 pbr-5.1.0 protobuf-3.6.1 six-1.11.0 tensorboard-1.11.0 tensorflow-1.12.0rc1 termcolor-1.1.0 werkzeug-0.14.1 – Neeraj Sharma Oct 25 '18 at 08:33
  • But my files are written in python3.5 So when i tried running my python code with 3.5 version still same error : Using TensorFlow backend. 2018-10-25 22:02:17.981480: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA : cannot connect to X server How to solve it? – Neeraj Sharma Oct 25 '18 at 08:36
  • 1
    You need to build the package using Python 3.5. IIRC you can set that by specifying the correct executable when running the `configure.py` script before the build. – hoefling Oct 25 '18 at 08:51
  • Can you show us the output of the uname -a command? – Dr. Snoopy Oct 25 '18 at 09:29
  • [Data Science Stack Exchange](https://datascience.stackexchange.com/) – jww Oct 25 '18 at 10:39
  • uname -a output Linux dssig-nuc7i7bnh 4.15.0-33-generic #36~16.04.1-Ubuntu SMP Wed Aug 15 17:21:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux – Neeraj Sharma Oct 25 '18 at 11:44
  • @hoefling - i changed path of python in ./configure and started building with below command bazel build -c opt --copt=-mavx --copt=-mfma --copt=-msse4.1 --copt=-msse4.2 -k //tensorflow/tools/pip_package:build_pip_package Tried this command as well: bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package – Neeraj Sharma Oct 25 '18 at 11:48
  • @hoefling - But getting error: /home/dssig/Downloads/tensorflow/tensorflow/python/eager/BUILD:10:1: undeclared inclusion(s) in rule '//tensorflow/python/eager:pywrap_tfe_lib': this rule is missing dependency declarations for the following files included by 'tensorflow/python/eager/pywrap_tensor.cc': 'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/arrayobject.h' 'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/ndarrayobject.h' – Neeraj Sharma Oct 25 '18 at 11:50
  • 1
    Looks like you either haven't installed `numpy` for Python 3.5, or you have not included its headers in bazel build. Run `pip3.5 show -f numpy | grep ndarrayobject.h`, do you get any output? If no, either numpy is missing or the installation is invalid. If yes, you have to pass the directory containing `ndarrayobject.h` via `copt`, e.g. `bazel build --copt=-I/path/to/python/lib/python3.5/site-packages/numpy/core/include`. However, when `numpy` is correctly installed (and `lib/python3.5/site-packages` is passed to bazel build), this shouldn't be necessary. – hoefling Oct 25 '18 at 18:51
  • I am getting output for pip3.5 show -f bumpy command numpy/core/include/numpy/ndarrayobject.h But when i checked the pathos site-packages, used python3.5 -m site command, it gives sys.path = [ '/home/dssig', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/home/dssig/.local/lib/python3.5/site-packages', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages', ] – Neeraj Sharma Oct 26 '18 at 04:17
  • @hoefling - For ./configure dist-pacakges path is asked but bumpy is in site-packages, should i provide path of site-packages instead of dist-packages path – Neeraj Sharma Oct 26 '18 at 04:37
  • @hoefling - I uninstalled numpy package and reinstalled and it worked. Tensor flow is build successfully. But still not out of all hazards. I created wheel file with command bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg But got below output warning: no files found matching '*.pyd' under directory '*' warning: no files found matching '*.pd' under directory '*' warning: no files found matching '*.dll' under directory '*' warning: no files found matching '*.lib' under directory '*' – Neeraj Sharma Oct 26 '18 at 06:34
  • warning: no files found matching '*.h' under directory 'tensorflow/include/tensorflow' warning: no files found matching '*' under directory 'tensorflow/include/Eigen' warning: no files found matching '*.h' under directory 'tensorflow/include/google' warning: no files found matching '*' under directory 'tensorflow/include/third_party' warning: no files found matching '*' under directory 'tensorflow/include/unsupported' Is that ok? – Neeraj Sharma Oct 26 '18 at 06:35
  • 1
    That's a warning, not an error, it just indicates that some files are not included. This is expected as you build on Ubuntu and `.pyd`, `.dll` etc. are Windows-specific files. As for missing headers in `tensorflow/include/{google,third_party,unsupported}` - it's vital that the headers are present in `tensorflow/include/tensorflow`, the rest is optional and for specific extensions which you night simply not have. If you can now install the wheel and run `python3.5 -c "import tensorflow"`, your job is done here. – hoefling Oct 26 '18 at 06:51
  • @hoefling - thank you so much for you help. Tensor flow is installed successfully. – Neeraj Sharma Oct 26 '18 at 10:52
  • Nice, glad I could help! – hoefling Oct 26 '18 at 10:53
  • @hoefling - i have one more issue https://stackoverflow.com/questions/53007924/videoio-error-v4l-cant-find-camera-device Please check if you can help me over this as well. – Neeraj Sharma Oct 26 '18 at 11:39
  • @hoefling my problem is solved now. You can ignore my last comment. – Neeraj Sharma Oct 29 '18 at 06:57

0 Answers0