ubuntu+anaconda+python安裝各版本tensorflow


一、安裝anaconda 

1.去官網下載anaconda linux版本即可

 

選擇合適的版本下載即可

2.安裝Aanconda:

打開終端(Ctrl+Alt+t)進入到下載的目錄一般在home 下的Downloads (或者進入到下載的文件夾右鍵打開open Terminal也可以)

執行命令bash Anaconda3-5.10-Linux-x86_64.sh 筆者是Anaconda3-5.10-Linux-x86_64版本的,這里是寫你下載的版本型號,回車,一路yes即可

安裝完成之后,打開新的Terminal終端,在終端中查看版本信息確認是否安裝

輸入conda-V

至此安裝完成

如果報錯,就配置一下anaconda 的環境變量
在終端輸入sudo gedit /etc/profile,打開profile文件。

在文件末尾添加一行:export PATH=/home/用戶名/anaconda3/bin:$PATH,保存    

重啟Linux 不然找不到命令

再輸入conda -V 驗證即可

3.創建環境

conda create -n flapp python=3.6(當然可以安裝任意python版本只需將3.6改掉即可)

4.激活環境

source activate flapp

二、tensorflow安裝

激活環境后在命令行輸入

1.使用pip安裝cpu版本的tensorflow

 

pip install --upgrade \
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.3.0-cp36-cp36m-linux_x86_64.whl

2.運行簡短的tensorflow 程序
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session() print(sess.run(hello))

如果輸出以下內容,則可以開始編寫TensorFlow程序了:

Hello, TensorFlow!
三、tensorflow python包的URL
python2.7
cpu支持:
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.3.0-cp27-none-linux_x86_64.whl
gpu 支持:
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.3.0-cp27-none-linux_x86_64.whl

python3.4

僅CPU:

https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.3.0-cp34-cp34m-linux_x86_64.whl

GPU支持:

https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.3.0-cp34-cp34m-linux_x86_64.whl

Python 3.5

僅CPU:

https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.3.0-cp35-cp35m-linux_x86_64.whl

GPU支持:

https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.3.0-cp35-cp35m-linux_x86_64.whl

Python 3.6

僅CPU:

https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.3.0-cp36-cp36m-linux_x86_64.whl

GPU支持:

https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.3.0-cp36-cp36m-linux_x86_64.whl

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM