samjabrahams / tensorflow-on-raspberry-pi

TensorFlow for Raspberry Pi
Other
2.24k stars 496 forks source link

Pi_examples folder #25

Open mweber7 opened 8 years ago

mweber7 commented 8 years ago

I installed your wheel on a Raspberry Pi3 (Raspbian, python2.7) using pip according to your instructions here. I confirmed that the install worked according to one of the basic hello tests on tensorflow.org. However, I could not find the pi_examples folder, found here, from the official tensorflow repository. Did I miss something or was this example folder omitted?

zxzhijia commented 8 years ago

@mweber7 You can download them from tensorflow github and run those examples.

On Thu, Jun 30, 2016 at 8:37 PM, mweber7 notifications@github.com wrote:

I installed your wheel on a Raspberry Pi3 (Raspbian, python2.7) using pip according to your instructions here https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_samjabrahams_tensorflow-2Don-2Draspberry-2Dpi&d=CwMCaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=X3YsXL1AZsKHgsh28HFY8A&m=VO3KH53mPWYyl5cZV7Sx1aXyBxc2s62qIQiDlo_ES5w&s=_3f1mJcEhdKLl6Bxo-vgU2pMMOkOl-atfe0hQ0ojS7g&e=. I confirmed that the install worked according to one of the basic hello tests on tensorflow.org. However, I could not find the pi_examples folder, found here https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_tensorflow_tensorflow_tree_master_tensorflow_contrib_pi-5Fexamples&d=CwMCaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=X3YsXL1AZsKHgsh28HFY8A&m=VO3KH53mPWYyl5cZV7Sx1aXyBxc2s62qIQiDlo_ES5w&s=1whMIhVhVL2N-Z9skUDYEzxlslFHVuxJ2KQ4gdS6v-w&e=, from the official tensorflow repository. Did I miss something or was this example folder omitted?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_samjabrahams_tensorflow-2Don-2Draspberry-2Dpi_issues_25&d=CwMCaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=X3YsXL1AZsKHgsh28HFY8A&m=VO3KH53mPWYyl5cZV7Sx1aXyBxc2s62qIQiDlo_ES5w&s=__uOAj11dOqXUAxJJUEtXUOSwDbErOmc5Tblv0XqSoA&e=, or mute the thread https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe_ALPsQA1iAU2Cn-5FVOIxmYx5847-5Ft-2DH-2DZ-5Fks5qRGFOgaJpZM4JCuFn&d=CwMCaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=X3YsXL1AZsKHgsh28HFY8A&m=VO3KH53mPWYyl5cZV7Sx1aXyBxc2s62qIQiDlo_ES5w&s=RQoKoXMXaeUZ6mlyC5k1hhPZoBNg07m7mjvvZILQdO0&e= .

samjabrahams commented 8 years ago

Thanks for the question @mweber7 - unfortunately, tensorflow/contrib/pi_examples/ and its related component tensorflow/contrib/makefile/ aren't included in the .whl files here. There are a couple of reasons for this, the biggest of which is that the Raspberry Pi TensorFlow binaries provided in this repo match up with what is contained in official TensorFlow releases. Additionally, the pi_examples and makefile do not interact with the Python portion of TensorFlow at all (they are C++ only), so bundling them in with a Python binary seems counterproductive.

As @zxzhijia mentioned, you can use the tensorflow/contrib/makefile instructions to statically compile TensorFlow C++ binaries, and then follow the README inside of the pi_examples folder. Note that the makefile instructions do not build the full TensorFlow Python library, but rather a set of static C++-only binaries.

These folders are worth pointing out, however, so I'll try to get around to mentioning both makefile and pi_examples in the README in this repository. I'll leave this issue open until I do so.

saurabhvyas commented 7 years ago

I was wondering why official examples folder examples wont work on pi 3 ? why do we have to use pi_examples instead , Is it for optimization ?

samjabrahams commented 7 years ago

@saurabhvyas which examples do you want to run? The main limitation on the Raspberry Pi is that training any model of significant size will cause the device to run out of memory. The pi_examples folder is completely separate from the standard examples folder (ie. they are not mutually exclusive).

saurabhvyas commented 7 years ago

I am trying to follow tensorflow's tutorial on image classificiation on pretrained model at https://www.tensorflow.org/tutorials/image_recognition , but I am getting the following error

pi@orangepi:~/tf_models/tutorials/image/imagenet $ python classify_image.py
>> Downloading inception-2015-12-05.tgz 100.0%
Successfully downloaded inception-2015-12-05.tgz 88931400 bytes.
Segmentation fault

I reran the same python file again , now getting


pure virtual method called
pure virtual method called
terminate called recursively
Aborted
samjabrahams commented 7 years ago

@saurabhvyas it's possible that is an issue specific to the Orange Pi. The script I use for benchmarking is based on that example and is only minimally altered.

saurabhvyas commented 7 years ago

@samjabrahams I love the orange color , so I renamed my raspberry pi 3 to orange pi , It is a pi 3 model b

samjabrahams commented 7 years ago

Got it- try downloading and running this file and see if it blows up again:

https://raw.githubusercontent.com/samjabrahams/tensorflow-on-raspberry-pi/master/benchmarks/inceptionv3/classify_image_timed.py