当前位置:网站首页>pytorch的安装(非常详细)
pytorch的安装(非常详细)
2022-07-27 09:49:00 【Redamancy06】
文章目录
1.pytorch的安装
1.1环境配置

运行这个

Anaconda安装详细步骤请看我之前写的http://t.csdn.cn/CZtm3
1.2创建pytorch文件夹(环境)


然后回车等待着安装

出现这个就按照成功了
再看文件夹就多了一个文件pytorch

然后我们输入命令进入pytorch环境conda activate pytorch

可以看到我们已经进入了pytorch环境
这个命令是查看该环境下所安装的包conda list
1.3查看pytorch历史版本
之前版本的链接https://pytorch.org/get-started/previous-versions/

我选择了这个,因为我的cuda下载的是11.1
1.4接下来有一个小技巧
我们在使用anaconda环境管理软件时,通过指令下载的各种包,其默认的源,也就是提供安装包或压缩包的服务器,是他们公司自己设立的。这个服务器的位置是在国外,因此链接速度慢,不稳定,下载速度也慢。我们可以通过指令将下载源置为国内源。
这里推荐清华源、中科大源。
1.4.1清华源:
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/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
1.4.2中科大源:
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
conda config --set show_channel_urls yes
将全部指令复制粘贴进命令行即可。换源之后下载速度起飞。
将这些指令复制到Anaconda里面

完成改下载源。

查看源有没有添加进去指令是
conda config --show-source
1.5开始下载pytorch环境

然后回车等待安装

这里是下载包的版本

这里显示的是所需要安装的 大小
填y回车

等待安装

安装成功

退出pytorch环境
conda deactivate

查看环境信息
conda info -e
完成
1.6验证pytorch安装成功

在pytorch环境中输入python,然后import torch,出现我这种情况就说明安装成功了
import torch

这个是验证cuda是不是可以正常运行
torch.cuda.is_available()

退出python环境
quit()
1.7卸载pytorch环境

这条语句是将pytorch环境删除,根据提示走,我就不演示了,好不容易下载好的环境,就不删了
conda remove -n pytorch --all
1.8将pycharm的环境换成Anaconda下的pytorch环境

点击settings


详细的看我的博客http://t.csdn.cn/emDn2

然后点add

完结
边栏推荐
- 并发之park与unpark说明
- 吃透Chisel语言.23.Chisel时序电路(三)——Chisel移位寄存器(Shift Register)详解
- 中高级试题」:MVCC 实现原理是什么?
- Oracle RAC 19C PDB instance is down
- Live countdown 3 days sofachannel 29 P2P based file and image acceleration system Dragonfly
- 刷题《剑指Offer》day04
- File upload of native input tag
- GO基础知识—数组和切片
- Summary of binary tree exercises
- Leetcode.814. binary tree pruning____ DFS
猜你喜欢

Food safety | the more you eat junk food, the more you want to eat it? Please keep this common food calorimeter

蚂蚁集团境外站点 Seata 实践与探索

Easy to understand! Graphic go synergy principle and Practice

NFT系统开发-教程

Explain knative cloud function framework in simple terms!

wordpress禁止指定用户名登录或注册插件【v1.0】

Excellent Kalman filter detailed article

吃透Chisel语言.22.Chisel时序电路(二)——Chisel计数器(Counter)详解:计数器、定时器和脉宽调制

A ride into Qinchuan -- a brief talk on how beego Autorouter works

Understand chisel language. 27. Chisel advanced finite state machine (I) -- basic finite state machine (Moore machine)
随机推荐
Leetcode.1260. 2D grid migration____ In situ violence / dimensionality reduction + direct positioning of circular array
StyleGAN论文笔记+修改代码尝试3D点云生成
When I went to oppo for an interview, I got numb
Qt 学习(二) —— .pro文件详解
并发之park与unpark说明
圆环工件毛刺(凸起)缺口(凹陷)检测案例
PCL的ICP配准示例
Annotation and reflection
Towards the peak of life
Acl2021 best paper released, from ByteDance
Food safety | the kitchen board environment is very important. Do you know these use details?
Gbase 8A MPP cluster capacity expansion practice
c'mon! Please don't ask me about ribbon's architecture principle during the interview
电机控制器中的MOS驱动
Anchor Free检测器:CenterNet
GO基础知识—数组和切片
LeetCode.1260. 二维网格迁移____原地暴力 / 降维+循环数组直接定位
Shell综合应用案例,归档文件、发送消息
GBase 8a MPP集群扩容实战
Review summary of engineering surveying examination