在查找资料过程中出现的报错
跳过前面的……
pip install --upgrade --ignore-installed tensorflow
安装tensorflow
失败
https好像过期了,换http
要先移除所有再添加
更新conda
conda update -n base -c defaults conda
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
移除所有网站channels
conda config --remove-key channels
查看网站channels
conda config --show-sources
版本不匹配出现的问题:gpu=1.15.0的版本
(pytorch) C:\Users\86185>conda install tensorflow-gpu=1.15.0
Channels:
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
- defaults
- https://mirrors.ustc.edu.cn/anaconda/pkgs/main
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: / warning libmamba Added empty dependency for problem type SOLVER_RULE_UPDATE
failed
LibMambaUnsatisfiableError: Encountered problems while solving:
- package tensorflow-gpu-1.15.0-h0d30ee6_0 requires tensorflow 1.15.0.*, but none of the providers can be installed
Could not solve for environment specs
The following packages are incompatible
├─ pin-1 is installable and it requires
│ └─ python 3.11.* , which can be installed;
└─ tensorflow-gpu 1.15.0** is not installable because it requires
└─ tensorflow 1.15.0.* but there are no viable options
├─ tensorflow 1.15.0 would require
│ └─ python 3.6.* , which conflicts with any installable versions previously reported;
└─ tensorflow 1.15.0 would require
└─ python 3.7.* , which conflicts with any installable versions previously reported.
说明我的3.11的python不匹配tensorflow的版本
找匹配python与tensorflow的网站:
从源代码构建 | TensorFlow
pytorch:
在命令提示符中输入nvidia-smi可得到
NVIDIA-SMI 512.36 Driver Version: 512.36 CUDA Version: 11.6
也就是说当前电脑最多只能安装到CUDA11.6版本
需要用conda,用pip的话比较麻烦
在官网找到相对应的,例如为为nvidia芯片,则
conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia
经查询,tensorflow最新可匹配的为python3.9的版本
结果是卡了半天进度条都不动,因为这些包都是国外网站的,卡是正常的,一般是最后403或者其他的下载失败
tensorflow与Pytorch最终下载鉴定都为失败,可能要换个网络试试不知道行不行,懂得都懂;
或者去官网看看吧
PyTorch
在 Windows 环境中从源代码构建 | TensorFlow