Error install Tensorflow

I need a tensorflow version larger than 1.4, but it generates the error in the image (tried on both python 2.7 and 3.6) Source: Installer TensorFlow avec pip


I managed to install tensorflow but only version 0.9.0 using:

wget https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v0.9.0/tensorflow-0.9.0-py3-none-any.whl
/usr/bin/python3 -m pip install tensorflow-0.9.0-py3-none-any.whl

But I need a version greater than 1.4 because I want to use keras and with my current version generates my error:
module ‘tensorflow’ has no attribute ‘keras’ (I have keras 2.2.4 installed)

Do you know how to solve the problem?
Thanks in advance.

1 Like

PYNQ is arm based platform so you need a wheel compatible with that. X86-64 wheels cannot work.

I tried other versions, but I found nothing compatible.

In that case, you perhaps need to bootstrap, which is more involved.

Could you please explain more how to bootstrap the PYNQ

You need to build tensorflow from source, instead of wheels. I have no success story on that though.

Thanks. I will try to do that and will keep you updated.

Hi @elsaam2y, I don’t know if you can find it helpful but there are a couple of projects on GitHub that you may be able to use as starting point:

Also I found this that should be more up-to-date:

Keep in mind though that this should be taken as only starting point as most likely you’ll need to adapt the steps to suit your needs.

May I ask you on what board specifically are you workin on? If you can tell us the architecture we might be able to provide a little more help.

Thanks for your kind response. I am working on PYNQ z_1 and I am trying to process a pre-designed ConvNet on it. I have already installed TensorFlow version 1.1, but the main problem is that I need a newer version to be compatible with keras. The last thing which I have done is to use Bazel build system to build Tensorflow from source, but I am stuck till now in this stage (limited card storage so I will use another bigger one) and I won’t know whether it will succeed or not.

It seems like you are on track for getting this to work! I honestly don’t see why you should not be able to succeed. And you can always avail of some help here in case you can’t make it.

In general, as the Pynq-Z1 shares the same architecture of the Raspberry Pi, I can confirm now you should be able to find what you need by looking for solutions for the RPI (as I did in my initial search).

Let us know how it goes!

1 Like

Unfortunately, it is not easy and I didn’t found anyone (till now) did it. The Raspberry works on Arm 64, while PYNQ uses 32 bit and this cause a big problem as the tensorflow versions are 64 bits. Right now I am trying to build it using Bazel, but still no success.

1 Like

Yeah, I have tried to build bazel on arm as well - no success - which means you probably cannot install tf on arm. I have been able to build bazel on aarch64 however. A lot of users are asking for installation on arm in the tensorflow community, but there is no solution there yet.

I am also trying to install TensorFlow using the PYNQ-Z2 board. Till now no success. Did anyone know how to install TensorFlow?

Hi there,

This is a fairly common question. The Pynq-Z2 has a 32-bit arm processor on it, so if you need to run tensorflow on it you need to compile it from source or find a project that ships these binaries for that architecture. I assume if you want something that works for a raspberry pi, for example, shouldn’t be too far fetched to port into the Pynq-Z2.

Here are some relevant posts from the past Tensorflow and keras on pynq z2. Hopefully one of the links in there will prove to be useful.

Thanks
Shawn