一.tensorflow 安装(参考博文:http://blog.csdn.net/bitcarmanlee/article/details/52749488)
1.依赖:anaconda
2.建立计算环境:
conda create -n tensorflow python=2.7
3.激活tf环境
source activate tensorflow
4.install tf
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
5.测试安装成功否:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print sess.run(hello)
6.退出tensorflow:
source deactivate
二.集成tensorflow 到ieda
1.安装 IntelliJIDEA (参考博文:http://www.linuxdiyf.com/linux/19143.html)
(1)下载地址:IntelliJ IDEA
(2)减压tar.gz包到opt文件夹下
(3)进入减压后的文件夹下的bin执行(启动idea):
/idea.sh
(4)点击右下角的plugins,找到加入python窗口
(5)新建test项目集成rensorflow
添加tensorflow 路径
(注:若不知道tensorflow 路径,通过以下命令查找
import tensorflow as tf
tf.__version__
tf.__path__
)
添加路径完成后
点next,然后建一个测试例子:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print sess.run(hello)
右键run htf.py 结果
至此集成完毕!
本文将多个博文成果学习整理,希望可以帮助到刚入手的同学们。