Anaconda中安裝Tensorflow的過程
Anaconda中如何安裝Tensorflow
(1) 建立一個 conda 計算環(huán)境名字叫tensorflow:
conda create -n tensorflow python=3.8
一定要指定python版本,否則安裝失敗。
(2)激活tensorflow環(huán)境,然后使用其中的 pip 安裝 TensorFlow。當(dāng)使用easy_install使用–ignore-installed標(biāo)記防止錯誤的產(chǎn)生。
activate tensorflow
(tensorflow)$ # Your prompt should change
(3)安裝tensorflow
pip install tensorflow
這里推薦用鏡像安裝,要不然太慢了。
(4)驗證安裝
python
import tensorflow as tf
表示成功。
問題1:出現(xiàn)這樣的情況
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.
直接指定特定源安裝
pip --default-timeout=100 install tensorflow==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
問題2:如果出現(xiàn)錯誤一:Cannot uninstall ‘wrapt’.
更新wrapt
pip install -U --ignore-installed wrapt enum34 simplejson netaddr
問題3:如果輸入之后,會發(fā)現(xiàn)它讓你升級pip的版本才可以,那么我們就先升級pip的版本
python -m pip install --upgrade pip
如果顯示這樣,表示安裝成功?。?!
2.檢測是否安裝成功
1.輸入:python
2.import tensorflow as tf
3.tf.version
4.tf.path
如下圖表示安裝成功
到此這篇關(guān)于Anaconda中如何安裝Tensorflow的文章就介紹到這了,更多相關(guān)Anaconda安裝Tensorflow內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
python基礎(chǔ)教程之基本數(shù)據(jù)類型和變量聲明介紹
這篇文章主要介紹了python基礎(chǔ)教程之基本數(shù)據(jù)類型和變量聲明介紹,首先講解了變量聲明的一些知識,然后列出最常用的基本數(shù)據(jù)類型,需要的朋友可以參考下2014-08-08Python ORM框架SQLAlchemy學(xué)習(xí)筆記之映射類使用實例和Session會話介紹
這篇文章主要介紹了Python ORM框架SQLAlchemy學(xué)習(xí)筆記之映射類使用實例和Session會話介紹,需要的朋友可以參考下2014-06-06