tensorflow-on-arm

TensorFlow for Arm

Github星跟蹤圖

Tensorflow-on-arm

Inspired by the tensorflow-on-raspberry-pi.
Tool for compile tensorflow for arm.

Dependences

apt-get install openjdk-8-jdk automake autoconf
apt-get install curl zip unzip libtool swig libpng-dev zlib1g-dev pkg-config git g++ wget xz-utils

# For python2.7
apt-get install python-numpy python-dev python-pip python-mock

# if using a virtual environment, omit the --user argument
pip install -U --user keras_applications==1.0.5 --no-deps
pip install -U --user keras_preprocessing==1.0.3 --no-deps

# For python3
apt-get install python3-numpy python3-dev python3-pip python3-mock

# if using a virtual environment, omit the --user argument
pip3 install -U --user keras_applications==1.0.5 --no-deps
pip3 install -U --user keras_preprocessing==1.0.3 --no-deps

TensorFlow on Raspberry Pi

It's officially supported!

Python wheels for TensorFlow are being officially supported. As well, this repository maintain up-to-date tensorflow wheels for raspberry pi.

installation

Check out the official TensorFlow website for more information.

Cross-compilation

Make you sure added arm architecture, see how to adds in debian flavors:

dpkg --add-architecture armhf
echo "deb [arch=armhf] http://httpredir.debian.org/debian/ buster main contrib non-free" >> /etc/apt/sources.list

if you want compile python support:

# For python2.7
apt-get install libpython-all-dev:armhf

# For python3
apt-get install libpython3-all-dev:armhf

using docker

cd build_tensorflow/
docker build -t tf-arm -f Dockerfile .
docker run -it -v /tmp/tensorflow_pkg/:/tmp/tensorflow_pkg/ --env TF_PYTHON_VERSION=3.7 tf-arm ./build_tensorflow.sh configs/<conf-name> # rpi.conf, rk3399.conf ...

Edit tweaks like bazel resources, board model, and others

see configuration file examples in: build_tensorflow/configs/

Finally, compile tensorflow.

cd build_tensorflow/
chmod +x build_tensorflow.sh
TF_PYTHON_VERSION=3.5 ./build_tensorflow.sh <path-of-config>
# If no output errors, the pip package will be in the directory: /tmp/tensorflow_pkg/

主要指標

概覽
名稱與所有者lhelontra/tensorflow-on-arm
主編程語言Shell
編程語言Shell (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2017-08-01 21:01:09
推送於2021-08-13 21:19:26
最后一次提交2020-12-21 01:49:54
發布數18
最新版本名稱v2.4.0 (發布於 )
第一版名稱v1.3.1 (發布於 )
用户参与
星數1.1k
關注者數44
派生數272
提交數174
已啟用問題?
問題數102
打開的問題數25
拉請求數14
打開的拉請求數2
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?