树莓派3 安装tensorflow1.9.0(神经网络)
一、首先查看python的版本,是否为python 3.5
python -V
如果是python2 或其它版本的,为了能成功安装tensorflow1.9.0(神经网络),建议先卸载其他版本的python
二、安装Python3.5 :
sudo apt-get install python3.5
1.删除已有的python 链接:
2.添加安装好的python3.5 版本
sudo ln -s /usr/bin/python3.5 /usr/bin/python
确认是python3.5 版本后,开始正式安装tensorflow1.9.0。
三、安装tensorflow1.9.0
如果之前安装过其他版本的tensorflow,先卸载,再安装
sudo pip3 uninstall tensorflow
sudo pip3 install --upgrade tensorflow-1.8.0-cp35-none-linux_armv7l.whl
方法一: sudo pip3 install --no-cache-dir tensorflow==1.9.0
可能会出错,
错误信息为:
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
方法二(推荐):
安装顺序:
sudo pip3 install --no-cache-dir astor
sudo pip3 install --no-cache-dir funcsigs
sudo pip3 install --no-cache-dir termcolor
sudo pip3 install --no-cache-dir protobuf
sudo pip3 install --no-cache-dir markdown
sudo pip3 install --no-cache-dir futures
sudo pip3 install --no-cache-dir numpy
sudo pip3 install --no-cache-dir mock
sudo pip3 install --no-cache-dir tensorboard==1.9.0
sudo pip3 install --no-cache-dir grpcio
sudo pip3 install --no-cache-dir absl-py
sudo pip3 install --no-cache-dir gast
sudo pip3 install --no-cache-dir tensorflow==1.9.0
如果,中途没出错,恭喜安装成功了。
下面测试一下:
在终端输入:
python
import tensorflow as tf
安装成功后,显示:
恭喜安装成功了。
希望对你有帮助。