Ubuntu16.04 Tensorflow安装

mac2022-06-30  121

Anaconda安装

Anaconda官网下载相应的版本 下载的文件名为:Anaconda2-4.4.0-Linux-x86_64.sh

打开安装界面

bash Anaconda2-4.4.0-Linux-x86_64.sh

阅读协议,不停yes即可。 安装完之后,source ~/.bashrc使用Anaconda环境变量。conda list查看Anaconda下的包,至此,Anaconda安装完成。

创建环境

conda create -n tensorflow python=2.7

基于python2.7创建名为tensorflow的环境,此处的环境的意义与虚拟环境类似

使用环境

source activate tensorflow

安装tensorflow

pip install --upgrade tensorflow

tensorflow是否安装成功

python # Python import tensorflow as tf hello = tf.constant('Hello, TensorFlow!') sess = tf.Session() print(sess.run(hello))

至此,tensorflow安装完成。 参考自:https://www.tensorflow.org/install/install_linux

转载于:https://www.cnblogs.com/HeJD/p/8702031.html

最新回复(0)