1.TensorFlow安装 ,在原本的虚拟环境下配置Tensorflowh和pytorch
2.我首先在anaconda的环境下创建了一个tensorflow文件夹
如何先进入D盘,再进入tensorflow文件夹的目录
java
D:
java
cd D:\Anaconda\TensorFlowSoftWare
java
pip install tensorflow
如图所示
报错解决方法
(1)升级pip
java
python -m pip install --upgrade pip -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
(2)用镜像源进行下载
1)清华镜像源:
pip3 install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
2)豆瓣
pip3 install numpy -i http://pypi.douban.com/simple/
3)中国科学技术大学
pip3 install numpy -i https://pypi.mirrors.ustc.edu.cn/simple
(3)输入
java
pip3 install tensorflow
安装继续失败 ,出现以下报错
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.
daal4py 2021.6.0 requires daal==2021.4.0, which is not installed.
numba 0.55.1 requires numpy<1.22,>=1.18, but you have numpy 1.24.3 which is incompatible.
经过这一通的瞎操作,我关了梯子,然后输入
java
pip3 install tensorflow
就下载成功了
3.下载成功如图所示
4.然后验证是否安装成功 输入
java
python
java
import tensorflow as tf
java
tf.__version__
显示如图所示,则安装成功