-
Notifications
You must be signed in to change notification settings - Fork 74.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tensorflow in armv7l #445
Comments
For completeness:
|
Any idea what the problem is here? |
No expert here, but pretty sure that exception trace is an artifact of the debugger. See https://bugs.launchpad.net/raspbian/+bug/1154042 for a similar issue with a good explanation. BTW, this is TensorFlow compiled in CPU only mode for the Pi, right? |
Looks like this fell through the cracks. @petewarden: Any thoughts here? |
In the meantime, the somewhat faster Pi v3 shipped. Perhaps that affects the possibilities (and feasibilities) around Tensorflow for Pi? https://en.wikipedia.org/wiki/Raspberry_Pi says "Raspberry Pi 3 has a new BCM2837 SoC retaining compatibility with the GPU, CPU and connectors of its predecessors BCM2835 (Pi 1) and BCM2836 (Pi 2), so all those projects and tutorials for Pi 1 and Pi 2 hardware should continue to work. The 900 MHz 32-bit quad-core ARM Cortex-A7 CPU complex has been replaced by a 1.2 GHz 64-bit quad-core ARM Cortex-A53. Combining a 33% increase in clock speed with various architectural enhancements, this provides a 50–60% increase in performance in 32-bit mode versus Raspberry Pi 2, or roughly a factor of ten over the original Pi 1." |
From the use case perspective I'd definitely like to see TensorFlow on Pi, at least for the predict function. I have a Pi that mines text and data from web daily and I am also planning to add NN processing to my scripts. I would train the model on my regular Core i7 dev box with a GPU but would love to run the prediction daily on the Pi (perhaps retraining the model monthly). Why Pi? Because it has more than enough power to run Python scripts and do the data processing that I need, and consumes only 2W at full load (the Pi2 model, Pi3 I believe is more like 3W). |
@martinwicke: What's the state of cmake in contrib? Would it be practical to get tensorflow compiling on a Pi rather than cross compiling? |
My plan is to get Blaze running on a Pi if I can. CMake isn't very pleasant to work with for this, in my experience. I hope to get to this asap. |
For what it's worth, I'm attempting to natively compile TensorFlow on a Raspberry Pi 3 running Raspbian. For the most part, I'm using a modified version of these instructions for building on a Jetson TK1, with the main changes being that I'm building Bazel 1.4 instead of 1.0, and I'm not building for Cuda. Here's where I'm getting hung up right now: I tried using Bazel to build the
After and 1.5 hours, it threw the following error message:
The first message said that the
And here's the full output, including Bazel messages before the error:
Not sure if this helps, but I figured I should share what I've got. |
Thanks for the update! That is helpful to see. I got as far as getting protobuf compiling, but I haven't made it to Bazel or TensorFlow itself yet. I'm hoping to work on that over the next few days. |
Should I upload my Pi's Bazel repository/binary/whatever somewhere? It may (or may not) save you some time. Additionally, I ran the failed
And got the following message:
This is my project for the next few days, so I'll try to post progress here. Let me know if messages are irrelevant- I'll remove those bits so I'm not clogging this thread. |
Well, I added a USB drive as swap space (RIP that drive soon), pulled the latest files from yesterday and tried it again, and after 3 hours it looks like I got |
I believe I've got it working. I removed the swap drive after installing and am able to run the base MNIST tutorial scripts from tensorflow/examples/tutorials/mnist. I can also play with the TensorFlow package in a Python REPL, and a loose look at I've got the process documented decently. I'm going to clean the instructions, test them on another Pi, attempt to install straight from the wheel file, and try out some other shenanigans. Hopefully have this knocked out over the weekend! |
Thanks Sam! I managed to get the label_image example compiling and running on my Pi 2, here are my notes:
|
Excellent! I was hoping to try out the process on a Pi 2 as well. Couple responses and additional notes
|
As another data point, I compiled and ran the label_image binary, and it took much less than a minute. I did not play around with any of the compiler settings. Could be a difference between the Pi2 and the Pi3. I'm also running Raspbian 8.0. Output:
|
Sorry about the RPi breakage, should be fixed in d2a06c2 |
Thanks @vrv, I rebuilt from source on a RPi3 and can confirm that it appears to work fine. I'll release an unofficial step-by-step guide on how I built the standard TensorFlow binaries from source specifically for the Raspberry Pi 3, as well as a link to a pre-compiled pip wheel. The wheel worked on a fresh Pi without any headaches, so I'm hoping people can use that if they don't absolutely have to go through the whole process. Once a "correct" process of building is established, what kind of tests should be run on the build to make you guys comfortable with putting a Raspberry Pi/Raspbian-targeted wheel on PyPi? Or would that be way too much maintenance overhead for you all? I only ask because I think it'd be pretty sexy to be able to |
Awesome work! Thanks @samjabrahams for putting everything together. Many of us tried this out. Glad someone succeeded. Closing this now. |
Thanks @vmayoral for all the effort you put into this on both the TensorFlow and Bazel front- you got the momentum for this rolling in the first place. Let me know if the instructions/wheel file work for you! |
Great work @samjabrahams and everyone else! I look forward testing and I think this is an exciting contribution for the machine learning + physical computing world overall. |
Fix a bug in the im2txt code where the Saver is created before the optimizer
I install tensorflow in Beaglebone black with Docker successfully. But when I predict model, it's failed that: |
As an update, I believe the original "pure virtual method called" crash should be addressed by this solution from the Pi StackOverflow board: https://raspberrypi.stackexchange.com/questions/48225/whats-causing-these-crashes-after-cross-compiling I'm testing it for a hopeful NEON-enabled Pi wheel we're working on at #11675 |
As an update, the fix mentioned in the answer above did seem to work. |
@vmayoral I have the same issue.
|
I followed your step and i got no any error in installing tensorflow , but when i use it , it showed me error import tensorflow as tf |
Hi,
I've cross-compiled tensorflow for
armv7l
and generated a wheel successfully however when deploying it into an embedded board with the same architecture (e.g.: Raspberry Pi 2), i get the following when executing https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/1%20-%20Introduction/helloworld.py:Digging a bit more:
cryt*
libraries in the machine used to cross compile tensorflow:cryt*
libraries in the target machine (Raspberry Pi 2):The text was updated successfully, but these errors were encountered: