URL:
https://blog.csdn.net/yjy728/article/details/71403271
https://www.2cto.com/kf/201704/625323.html
————————————————————————————————————————————————————————————————————————————————————
一、安装Anaconda
windows只支持python3.5.X,ubuntu下直接下最新版的就行,如果需要python3.5的anaconda,可以去官网历史版本找anaconda4.2.0版本下载
https://repo.continuum.io/archive/index.html
Anaconda3-4.2.0-Linux-x86_64.sh | 455.9M |
- $ cd /home/abner/下载/
- $ bash ./Anaconda3-4.2.0-Linux-x86_64.sh
二、安装tensorflow
python3.5版本的:
- $ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.0-cp35-cp35m-linux_x86_64.whl
cpu版一句话就行了
推荐安装python2.7的tensorflow,命令改为:
- $ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.0-cp27-none-linux_x86_64.whl
重启终端才能import tensorflow成功
如果需要别的版本可以去
https://storage.googleapis.com/tensorflow/根据自己需要的操作系统、python版本、tensorflow版本,cpu,gpu版选择,只需要改一下该命令 最后的名字即可。现在tensorflow已经更新到1.3.0
三、安装opencv
官方教程:
- conda install -c menpo opencv3=3.2.0
但是可能由于墙的原因,一直连接超时
Tips:
对于已经装了ROS下的opencv同学,import cv2会遇到以下问题
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type
- $ gedit /home/abner/.bashrc
- source /opt/ros/kinetic/setup.bash
- $ source ~/.bashrc