精品伊人久久大香线蕉,开心久久婷婷综合中文字幕,杏田冲梨,人妻无码aⅴ不卡中文字幕

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
TensorFlow學習筆記(一補):使用Anaconda安裝TensorFlow

最近,tensorflow網站上給出了新的使用Anaconda配置和安裝Tensorflow的步驟,經過測試,在國內可以無障礙的訪問。Anaconda 是一個基于Python的科學計算包集合,目前支持Python 2.7和3.5。


注意:在安裝過程中如果出現很長的報錯,觀察錯誤信息的末尾,如果是網絡鏈接相關,就重新運行一遍語句即可(如出現進度條不動的情況,也可重新運行語句),Anaconda自身約500M,tensorflow所需軟件包約幾十M。

操作系統: Ubuntu 14.04

1. 安裝Anaconda

從anaconda官網(https://www.continuum.io/downloads)上下載Linux版本的安裝文件(推薦Python 2.7版本),運行sh完成安裝。

2. 建立一個tensorflow的運行環境

[plain] view plain copy
  1. # Python 2.7  
  2. $ conda create -n tensorflow python=2.7  
  3.   
  4. # Python 3.4  
  5. $ conda create -n tensorflow python=3.4  
  6.   
  7. # Python 3.5  
  8. $ conda create -n tensorflow python=3.5  

3.在conda環境中安裝tensorflow

在conda環境中安裝tensorflow的好處是可以便捷的管理tensorflow的依賴包。分為兩個步驟:激活上一步建立的名為tensorflow的conda環境;用conda或者pip工具安裝Tensorflow,作者選擇的是pip方式。

3.1 pip方式

pip方式需要首先激活conda環境

[plain] view plain copy
  1. $ source activate tensorflow  

然后根據要安裝的不同tensorflow版本選擇對應的一條環境變量設置export語句(操作系統,Python版本,CPU版本還是CPU+GPU版本)

[plain] view plain copy
  1. # Ubuntu/Linux 64-bit, CPU only, Python 2.7  
  2. (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl  
  3.   
  4. # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7  
  5. # Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.  
  6. (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl  
  7.   
  8. # Mac OS X, CPU only, Python 2.7:  
  9. (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0-py2-none-any.whl  
  10.   
  11. # Mac OS X, GPU enabled, Python 2.7:  
  12. (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.10.0-py2-none-any.whl  
  13.   
  14. # Ubuntu/Linux 64-bit, CPU only, Python 3.4  
  15. (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp34-cp34m-linux_x86_64.whl  
  16.   
  17. # Ubuntu/Linux 64-bit, GPU enabled, Python 3.4  
  18. # Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.  
  19. (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp34-cp34m-linux_x86_64.whl  
  20.   
  21. # Ubuntu/Linux 64-bit, CPU only, Python 3.5  
  22. (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp35-cp35m-linux_x86_64.whl  
  23.   
  24. # Ubuntu/Linux 64-bit, GPU enabled, Python 3.5  
  25. # Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.  
  26. (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp35-cp35m-linux_x86_64.whl  
  27.   
  28. # Mac OS X, CPU only, Python 3.4 or 3.5:  
  29. (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0-py3-none-any.whl  
  30.   
  31. # Mac OS X, GPU enabled, Python 3.4 or 3.5:  
  32. (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.10.0-py3-none-any.whl  

最后根據是python 2還是3版本選擇一句進行安裝。

[plain] view plain copy
  1. # Python 2  
  2. (tensorflow)$ pip install --ignore-installed --upgrade $TF_BINARY_URL  
  3.   
  4. # Python 3  
  5. (tensorflow)$ pip3 install --ignore-installed --upgrade $TF_BINARY_URL  


3.2 conda方式

conda上面目前有人已經做好了tensorflow的pkg,但是版本不一定最新,且只有CPU版本,不支持GPU。

步驟也是首先激活conda環境,然后調用conda install 語句安裝.

[plain] view plain copy
  1. $ source activate tensorflow  
  2. (tensorflow)$  # Your prompt should change  
  3.   
  4. # Linux/Mac OS X, Python 2.7/3.4/3.5, CPU only:  
  5. (tensorflow)$ conda install -c conda-forge tensorflow  

上面的步驟完成后,從conda環境中退出:

[plain] view plain copy
  1. (tensorflow)$ source deactivate  



4. 測試安裝

[plain] view plain copy
  1. $ source activate tensorflow  
  2. (tensorflow)$  # Your prompt should change.  
  3. # Run Python programs that use TensorFlow.  
  4. ...  
  5. # When you are done using TensorFlow, deactivate the environment.  
  6. (tensorflow)$ source deactivate  


本站僅提供存儲服務,所有內容均由用戶發布,如發現有害或侵權內容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
win10下基于python(anaconda)安裝gpu版本的TensorFlow以及kears深度學習框架
Windows +TensorFlow+Faster Rcnn 詳細安裝步驟(一)
Win10上安裝Keras 和 TensorFlow(GPU版本)
TensorFlow在windows上安裝與簡單示例
解決安裝AI算法庫TensorFlow 2.0的最新入坑指南以及詳細的安裝教程【分別在linux和w...
TensorFlow 安裝教程
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯系客服!

聯系客服

主站蜘蛛池模板: 蓬莱市| 正宁县| 南木林县| 德清县| 沐川县| 高阳县| 淳化县| 大港区| 井陉县| 阿勒泰市| 涿州市| 应城市| 静乐县| 抚远县| 马山县| 临沧市| 北安市| 航空| 庆元县| 龙江县| 垣曲县| 温泉县| 浪卡子县| 名山县| 长沙市| 沂南县| 绥芬河市| 杭锦旗| 玛多县| 红河县| 青州市| 苗栗市| 万宁市| 滁州市| 沽源县| 仁化县| 凌源市| 盐源县| 响水县| 尼玛县| 长泰县|