snipsco / tensorflow-build

A set of scripts to (cross-)build the Tensorflow C lib for various architectures / OS
MIT License
178 stars 92 forks source link

how can I use this with python bindings? #15

Closed mattfeury closed 7 years ago

mattfeury commented 7 years ago

hello! thanks for the wonderful work and here and making it available.

i'm attempting to build tensorflow on my pi a+. it's my understanding that this repo will help me build the .so file leaving me with a tensorflow library. my question is, how can i use this library with the existing tensorflow python bindings? i'd like to continue to use keras + all my existing TF python code, and am just hoping that I need to "swap" the backend library being used to one built for this architecture.

any pointers would be helpful! thanks

fredszaq commented 7 years ago

Hi !

You'll need to change the Basel target tensorflow:libtensorflow.so at the end of cross-compile.sh to build the Python package, certainty something like tensorflow/tools/pip_package:build_pip_package (the libtensorflow.so only contain the c api and not the required ffi code for Python)

Be prepared to change things in the script to build it, each new combination of platform / Basel target can be quite a journey :P

fredszaq commented 7 years ago

There are now uptream tensorflow python packages for the Pi, see this article https://petewarden.com/2017/08/20/cross-compiling-tensorflow-for-the-raspberry-pi/