Use piwheels for tensorflow on a raspberry pi and upgrade to tensorflow 1.8.0

Way less of a hassle
pull/101/head
Matthew D. Scholefield 2018-06-14 16:33:58 -05:00
parent b14c4b34b8
commit 19f95ae034
3 changed files with 12 additions and 18 deletions

View File

@ -18,8 +18,8 @@ PyYAML==3.12
scipy==1.0.1
six==1.11.0
speechpy-fast==2.3
tensorboard==1.7.0
tensorflow==1.7.0
tensorboard==1.8.0
tensorflow==1.8.0
termcolor==1.1.0
typing==3.6.4
wavio==0.0.3

View File

@ -41,7 +41,7 @@ setup(
},
install_requires=[
'numpy',
'tensorflow',
'tensorflow==1.8.0', # Must be on piwheels
'speechpy-fast>=2.4',
'pyaudio',
'keras',

View File

@ -22,19 +22,13 @@ wait_for_apt() {
fi
}
vpython() { "$VENV/bin/python" $@; }
vpip() { "$VENV/bin/pip" $@; }
install_tensorflow_armv7l() {
maj_min=$(python3 -c "import sys; i = sys.version_info; print(str(i[0]) + str(i[1]))")
whl=tensorflow-1.1.0-cp34-cp34m-linux_armv7l.whl
ver_whl=${whl//34/$maj_min}
url=https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v1.1.0/$whl
wget "$url" -O $ver_whl
vpip install "$ver_whl"
vpip uninstall mock || true; vpip install mock
rm "$ver_whl"
has_piwheels() { cat /etc/pip.conf 2>/dev/null | grep -qF 'piwheels' }
install_piwheels() {
echo "Installing piwheels..."
echo "
[global]
extra-index-url=https://www.piwheels.org/simple
" | sudo tee -a /etc/pip.conf
}
#############################################
@ -55,8 +49,8 @@ if [ ! -x "$VENV/bin/pip" ]; then curl https://bootstrap.pypa.io/get-pip.py | vp
arch="$(python3 -c 'import platform; print(platform.machine())')"
if [ "$arch" = "armv7l" ] && ! vpython -c 'import tensorflow' 2>/dev/null; then
install_tensorflow_armv7l
if [ "$arch" = "armv7l" ] && ! has_piwheels; then
install_piwheels
fi
vpip install -e runner/