lhelontra / tensorflow-on-arm

TensorFlow for Arm
MIT License
1.05k stars 274 forks source link

Raspberry Pi 3: fails to install #26

Closed Kriechi closed 5 years ago

Kriechi commented 6 years ago

Hi,

I have a Raspberry Pi 3, with Raspbian Jessie. The latet wheel package from here does not install:

$ wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.9.0/tensorflow-1.9.0-cp35-none-linux_armv7l.whl
$ sudo pip3 install tensorflow-1.9.0-cp35-none-linux_armv7l.whl
tensorflow-1.9.0-cp35-none-linux_armv7l.whl is not a supported wheel on this platform.
Storing debug log for failure in /root/.pip/pip.log
$ uname -a
Linux medal-3 4.4.21-v7+ #911 SMP Thu Sep 15 14:22:38 BST 2016 armv7l GNU/Linux
$ lsb_release -sc
jessie
$ sudo cat /root/.pip/pip.log
------------------------------------------------------------
/usr/bin/pip3 run on Fri Aug 10 22:03:30 2018
tensorflow-1.9.0-cp35-none-linux_armv7l.whl is not a supported wheel on this platform.
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 269, in run
    InstallRequirement.from_line(name, None))
  File "/usr/lib/python3/dist-packages/pip/req.py", line 168, in from_line
    raise UnsupportedWheel("%s is not a supported wheel on this platform." % wheel.filename)
pip.exceptions.UnsupportedWheel: tensorflow-1.9.0-cp35-none-linux_armv7l.whl is not a supported wheel on this platform
lhelontra commented 6 years ago

Hi, I'm tested tensorflow-1.9.0-cp35-none-linux_armv7l.whl on rpi2 and odroid-xu4, works fine. Checks md5 of file:

md5sum tensorflow-1.9.0-cp35-none-linux_armv7l.whl 
f4a9968dbc2ce0b99a4da8979a123a91 tensorflow-1.9.0-cp35-none-linux_armv7l.whl
Kriechi commented 6 years ago

It seems to be related to jessie. On another RPi3 of mine, which is running Raspian stretch, it installed fine.

Any chance to build a tensorflow wheel that works on jessie? I have quite a large fleet of RPis with Raspbian jessie in production systems.

lhelontra commented 6 years ago

Try install tensorflow without installing by pip:

$ mkdir ~/test_tensorflow
$ cd ~/test_tensorflow/
$ wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.9.0/tensorflow-1.9.0-cp35-none-linux_armv7l.whl
$ unzip tensorflow-1.9.0-cp35-none-linux_armv7l.whl
$ rm -rf tensorflow-1.9.0.dist-info/
$ mv tensorflow-1.9.0.data/purelib/tensorflow/ .
$ rm -rf tensorflow-1.9.0.data/

# test if imports tensorflow works:
$ python3 -c "import tensorflow"
# if working, move tensorflow directory to /usr/lib/python3/dist-packages/
$ mv tensorflow/ /usr/lib/python3/dist-packages/
adrienlaveau commented 5 years ago

Hi,

I tried it on my raspberry pi 3 with armv7 and could not make it work with tensorflow 1.10

Do you have any update on the subject ?

Thank you in advance for your help

yodakohl commented 5 years ago

sudo pip install --no-cache-dir https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.10.0/tensorflow-1.10.0-cp27-none-linux_armv7l.whl worked for me on Pi3

Takes a while (at least 20 minutes) because of numpy.

adrienlaveau commented 5 years ago

Hello, thank you for your answer, just a summary of what I did : First : I tried to install tensorflow-1.10.0-cp35-none-linux_armv7l.whl using $sudo pip3 install https://github.com/lhelontra/tensorflow-on- arm/releases/download/v1.10.0/tensorflow-1.10.0-cp35-none-linux_armv7l.whl But it gives me the following error : tensorflow-1.10.0-cp35-none-linux_armv7l.whl is not a supported wheel on this platform.

So as lhelontra advised, I tried to install it whitout using pip following this lines : $ mkdir ~/test_tensorflow $ cd ~/test_tensorflow/ https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.10.0/tensorflow-$ 1.10.0-cp35-none-linux_armv7l.whl $ unzip tensorflow-1.10.0-cp35-none-linux_armv7l.whl $ rm -rf tensorflow-1.10.0.dist-info/ $ mv tensorflow-1.10.0.data/purelib/tensorflow/ . $ rm -rf tensorflow-1.10.0.data/

And when i run the following line to check if it works $ python3 -c "import tensorflow"

I get the following error message. pi@raspberrypi:~/test_tensorflow $ python3 -c "import tensorflow" Traceback (most recent call last): File "/home/pi/test_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "/home/pi/test_tensorflow/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "/home/pi/test_tensorflow/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "/usr/lib/python3.4/imp.py", line 243, in load_module return load_dynamic(name, filename, file) ImportError: /lib/arm-linux-gnueabihf/libm.so.6: versionGLIBC_2.23' not found (required by /home/pi/test_tensorflow/tensorflow/python/_pywrap_tensorflow_internal.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/home/pi/test_tensorflow/tensorflow/init.py", line 22, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "/home/pi/test_tensorflow/tensorflow/python/init.py", line 49, in from tensorflow.python import pywrap_tensorflow File "/home/pi/test_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "/home/pi/test_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "/home/pi/test_tensorflow/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/home/pi/test_tensorflow/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "/usr/lib/python3.4/imp.py", line 243, in load_module return load_dynamic(name, filename, file) ImportError: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.23' not found (required by /home/pi/test_tensorflow/tensorflow/python/_pywrap_tensorflow_internal.so)

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions. Include the entire stack trace above this error message when asking for help. `

Then following your recommandation yodakhol, i tried the option --no-cache-dir but it tells me the same. sudo pip3 install --no-cache-dir https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.10.0/tensorflow-1.10.0-cp27-none-linux_armv7l.whl --> tensorflow-1.10.0-cp27-none-linux_armv7l.whl is not a supported wheel on this platform. and `sudo pip3 install --no-cache-dir https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.10.0/tensorflow-1.10.0-cp27-none-linux_armv7l.whl ' --> tensorflow-1.10.0-cp27-none-linux_armv7l.whl is not a supported wheel on this platform

Any other hint ? How can I know the exact point in which my platform does not correspond to the wheel file ?

adrienlaveau commented 5 years ago

Hello everyone,

Would you have any help about this issue "sudo pip install --no-cache-dir https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.10.0/tensorflow-1.10.0-cp27-none-linux_armv7l.whl"

How can I know if all the requisite for this wheel are on my pi ?

Thanks a lot

stanlee321 commented 5 years ago

I think you are trying to install a python2.7 version of TF into the python3 interpreter "pip3" so you are getting this error of not a supported wheel, I get the same error when I was trying to install a python3.4 version of TF into a python3.5 interpreter. Check what version of python3 interpreter are you using, $ python3 --version .

lhelontra commented 5 years ago

@adrienlaveau hi, checks if your distribution is stretch and upgrade glib:

sudo apt-get upgrade libstdc++6
adrienlaveau commented 5 years ago

Hi,

Thanks a lot for the advices. I figured out yesterday nigth that there was a new delivery of debian : stretch. Installing it solved the issue. Now I have tensorflow 11 and no more issue with tensorboard. Solved!

El dom., 7 de oct. de 2018 13:12, Leonardo lontra notifications@github.com escribió:

@adrienlaveau https://github.com/adrienlaveau hi, checks if your distribution is stretch and upgrade glib:

sudo apt-get upgrade libstdc++6

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lhelontra/tensorflow-on-arm/issues/26#issuecomment-427644951, or mute the thread https://github.com/notifications/unsubscribe-auth/AbWN3Zds2rHXZ3ffQQ_rQFB-0PSTuyy7ks5uieGvgaJpZM4V4v1H .