包的安装pytoch以及其他

在这里插入图片描述

pytorch利用pip安装教程

pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html

查看服务器的cuda版本

ls -l /usr/local | grep cuda

之后在pytorch官网找到torch和torchvision对应的版本,在https://download.pytorch.org/whl/torch_stable.html该网址找到torch和你的电脑cuda对应的版本。

# 如果安装的cuda版本不匹配
RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED

pip查看可安装的包的版本

以scikit-learn为例

pip install scikit-learn==

输入命令后显示的结果:
在这里插入图片描述

note: This error originates from a subprocess, and is likely not a problem with pip.

我在安装scikit-learn==0.23.2时报错,采取的解决办法如下:

  1. 给python降级,我原型安装的版本是3.10.2,现在换成3.7版本。
conda install python==3.7

成功安装包
在这里插入图片描述

删除无用的包:conda clean -a

https://blog.csdn.net/m0_56077202/article/details/120144424
conda的清理一些细节补充:链接

conda安装镜像源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2

conda创建,复制和删除环境

conda create -n crowdTh python==指定的python版本
conda create -n crowdTh --clone crowdCo
conda remove -n crowdTh --all

conda 解决An HTTP error occurred when trying to retrieve this URL.(已经更新清华源但也无解的解决方法)

https://blog.csdn.net/viki_2/article/details/118893250

pip安装镜像源

在下载pytorch的包时,发现中科院的镜像源速度最快,建议采用

pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值