栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

win10上安装tensorflow2.6.0

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

win10上安装tensorflow2.6.0

当然 在这之前 你需要安装anaconda,略…
numpy==1.19.2

 pip install --target=d:anaconda3libsite-packages (1.19.5)  numpy==1.19.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

选择这两个版本的原因是:
当前的tf是2.6.0 对应的numpy 是1.19.2

(base) PS C:Userslenovo> pip install numpy -i
https://pypi.tuna.tsinghua.edu.cn/simple Looking in indexes:
https://pypi.tuna.tsinghua.edu.cn/simple Requirement already
satisfied: numpy in d:anaconda3libsite-packages (1.19.5)
ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow 2.6.0 requires numpy~=1.19.2, but you have numpy 1.21.2 which is incompatible.

tensorflow==2.6.0

  pip install -U tensorflow==2.6.0 --target=d:anaconda3libsite-packages (2.6.0)  -i https://pypi.tuna.tsinghua.edu.cn/simple

报错

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
spyder 4.2.5 requires pyqt5<5.13, which is not installed.
spyder 4.2.5 requires pyqtwebengine<5.13, which is not installed.
conda-repo-cli 1.0.4 requires pathlib, which is not installed.
anaconda-project 0.9.1 requires ruamel-yaml, which is not installed.

对应四个错误提示的补丁

pip install pyqtwebengine==5.12  -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install pyqt5==5.12  -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install pathlib  -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install ruamel-yaml  -i https://pypi.tuna.tsinghua.edu.cn/simple

运行

(base) PS C:Userslenovo> ipython
In [1]: import tensorflow as tf
2021-10-12 14:33:33.656932: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-10-12 14:33:33.670924: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
In [2]: tf.__version__
Out[2]: '2.6.0'

关于两个 警告:

使用新的Tensorflow 2.1版本,默認的tensorflow
pip包含TF的CPU和GPU版本,在以前的tF版本中,找不到CUDA庫會發出一個錯誤,並引發一個異常,而現在這個庫會自動搜索正確的CUDA版本,如果找不到它,就會發出警告(W代表警告,錯誤是E(或F代表致命錯誤),並返回到CPU模式,2020-01-20
12:27:44.554767 : W
tensorflow/stream_executor/platform/default/dso_loader.cc:55] could
not load dynamic library’cudart64_101.dll’; dlerror : cudart64_101.dll
not found 2020-01-20 12:27:44.554964 : i
tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart
dlerror if you do not have a GPU set up on your machine.

如果你的機器上沒有CUDA
GPU,或者你不關心GPU加速,那麼無需擔心,如果安裝了Tensorflow並想要GPU加速,請檢查CUDA安裝(TF 2.1需要CUDA
10.1)。如果只想刪除警告,你可以調整TF的日誌記錄級別來禁止顯示警告,但是有缺點,因為它會關閉所有警告。Tensorflow 1.X或2.0:your CUDA setup is broken, ensure you have the correct version installed. (你的CUDA設置已損壞,請確保安裝了正確的版本。)

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/316239.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号