日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

windows下安装TensorFlow(清华镜像)

發布時間:2025/3/20 57 豆豆
生活随笔 收集整理的這篇文章主要介紹了 windows下安装TensorFlow(清华镜像) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

安裝Tensorflow(2.2.0)

    • 安裝aconda
    • 進入aconda prompt
    • 指令操作:
    • pycharm配置
    • 清華鏡像

安裝aconda

進入aconda prompt

指令操作:

  • 輸入:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

再接著輸入:
conda config --set show_channel_urls yes
這兩行代碼用來改成連接清華鏡像的

  • 接下來安裝Tensorflow環境,在Anaconda Prompt中輸入:
conda create -n tensorflow python=3.7.6

安裝完使用指令查看環境是否安裝成功

conda info --envs

看到上面這些activate tensorflow

我們要安裝的是CPU版本,那么在命令下緊接著輸入:
打開anaconda prompt

CPU版本:

pip install tensorflow==2.2.0 -i https://pypi.doubanio.com/simple

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(清华镜像)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。