anaconda以及Tensorflow,pycharm安装
一,安装anaconda,注意事项(全选)
二,安装Tensorflow
打开cmd,
(1) 建立一个 conda 计算环境名字叫tensorflow:(注意,python=3.6,写成3.6.5第一次没按成)
conda create -n tensorflow python=3.6
打开环境:activate tensorflow
退出环境:deactivate
(2)正式安装相应版本的tensorflow(使用清华镜像)
pip install tensorflow==1.12 -i https://pypi.tuna.tsinghua.edu.cn/simple
(3)安装完成,检测
>>>import tensorflow as tf
>>> hello=tf.constant('hello,tensorf')
>>> sess=tf.Session()
2020-09-20 14:33:23.697955: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
>>> print(sess.run(hello))
b'hello,tensorf'
不报错,成功。退出:conda.bat deactivate
二:将Tensorflow环境嵌入到编辑器中
环境:Tensorflow和Pycharm编辑器
步骤:
1:下载Pycharm软件,,(对勾全选)
2:使用Pycharm创建一个项目
3:设置项目的相关内容
找到我们安装的Anadonda中的env中的tensorflow中的python.exe。
即可