一、安装pip管理工具
sudo apt-get install python-pip python-dev
sudo -H pip install --upgrade pip
二、设置TensorFlow下载地址并安装
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.4.0-cp27-none-linux_x86_64.whl
pip --default-timeout=1000 install -U pip
sudo pip install --upgrade $TF_BINARY_URL
下载过程中会经常失败,如下图,要多试几次。
三、问题与解决
- WARNING:The directory ‘/home/zyh/.cache/pip’ or its parent directory is not owned or is not writable by the current user.The cache has been disabled.Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
解决:
sudo chown -R root /home/USERNAME/.cache/pip/
,将USERNAME换成自己的名字。 - ERROR: Cannot uninstall ‘enum34’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
解决:要卸载‘enum34’,在终端输入如下指令
sudo pip install --ignore-installed enum34
- ERROR: Cannot uninstall ‘pyasn1-modules’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
解决:
sudo pip install --ignore-installed pyasn1-modules
- 安装成功,如下图所示:
四、运行例程
先安装一些依赖库,安装过程可能会失败,还是要多试几次。
sudo apt-get install protobuf-compiler python-pil python-lxml
sudo pip install jupyter
sudo pip install matplotlib
从github下载功能包,并进行编译。执行tensorflow_object_detector.launch文件,如下图所示
文章不妥之处还望指正