windows下安装TensorFlow(清华镜像)
安裝Tensorflow(2.2.0)
- 安裝aconda
- 進入aconda prompt
- 指令操作:
- pycharm配置
- 清華鏡像
安裝aconda
進入aconda prompt
指令操作:
- 輸入:
再接著輸入:
conda config --set show_channel_urls yes
這兩行代碼用來改成連接清華鏡像的
- 接下來安裝Tensorflow環境,在Anaconda Prompt中輸入:
安裝完使用指令查看環境是否安裝成功
conda info --envs看到上面這些activate tensorflow
我們要安裝的是CPU版本,那么在命令下緊接著輸入:
打開anaconda prompt
CPU版本:
GPU版本:
pip install tensorflow-gpu==2.2.0 -i https://pypi.doubanio.com/simple二選一即可,
安裝完成后,
在anaconda prompt中以此輸入python、import tensorflow
你也可以自己選擇對應的Tensorflow版本,可以在清華鏡像中查看
測試
在Anaconda Prompt窗口中輸入: python
進入python后輸入:
import tensorflow as tf tf.__version__ tf.__path__pycharm配置
清華鏡像
https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/tensorflow/
其他方式:
使用清華開源鏡像安裝tensorflow
安裝tensorflow時,如果使用直接安裝速度相對較慢,采取清華大學的鏡像會提高速度。
GPU版本安裝方法:
pip install tensorflow-gpu==1.8 -i https://pypi.tuna.tsinghua.edu.cn/simple
或
pip install tensorflow==1.8 -i https://pypi.tuna.tsinghua.edu.cn/simple
清華源:https://pypi.tuna.tsinghua.edu.cn/simple
豆瓣源:https://pypi.doubanio.com/simple
安裝gpu報錯:
Could not install packages due to an EnvironmentError: [WinError 5] 拒絕訪問
參考文章:https://blog.csdn.net/weixin_44322778/article/details/122344787
完成安裝過程如下圖所示:
anaconda promot中指令:
(tensorflow) C:\Users\cgh>pip install tensorflow==1.15 -i https://pypi.tuna.tsinghua.edu.cn/simple (tensorflow) C:\Users\cgh>pip install tensorflow-gpu==1.15 -i https://pypi.tuna.tsinghua.edu.cn/simple總結
以上是生活随笔為你收集整理的windows下安装TensorFlow(清华镜像)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 图像处理:聚类方法
- 下一篇: 亲测可用:Anaconda Windo