首页 > 其他分享 >pytorch安装

pytorch安装

时间:2022-12-04 18:22:26浏览次数:57  
标签:cn Pictures pytorch tsinghua https edu tuna 安装

pytorch安装

1、查看本机的CUDA版本

cmd命令行输入nvidia-smi,在第一行最右边可以看到CUDA的版本号

![version](C:\Users\nice7\Pictures\Saved Pictures\version.png)

2、安装Pytroch

1、点击进入Pytorch官网

![pytorch](C:\Users\nice7\Pictures\Saved Pictures\pytorch.png)

这里进行Pytorch版本的选择,首先我选择的是Stable稳定版,然后OS是Windows系统,Package包就使用Conda,Language肯定选Python,最后的Compute Platform就根据大家的需求来定了。大家如果想在自己电脑(具有NVIDIA显卡)上跑通代码,就选CUDA,如果不需要在自己电脑上跑(在服务器上跑)或者没有独立显卡,就选CPU。
2、conda创建虚拟环境

# 创建
conda create --prefix=h:/**** python=3.7  
# 进入虚拟环境
activate h:/**** 

粘贴上面复制的安装命令

conda 安装一直卡在 Solving environment:

编辑 C:\Users\nice7.condarc

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
show_channel_urls: true

安装成功会显示 done

![done](C:\Users\nice7\Pictures\Saved Pictures\done.png)

测试

![测试](C:\Users\nice7\Pictures\Saved Pictures\测试.png)

[WinError 126] 找不到指定的模块。 Error loading "e:\conda_env\lib\site-packages\torch\lib\caffe2_nvrtc.dll" or one of its dependencies.

pip 换源

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
#  豆瓣镜像源
```python
pip config set global.index-url https://pypi.douban.com/simple/ 

标签:cn,Pictures,pytorch,tsinghua,https,edu,tuna,安装
From: https://www.cnblogs.com/kai-/p/16950334.html

相关文章

  • Linux使用 RPM 安装 Kibana
    参考地址:https://www.elastic.co/guide/en/kibana/8.5/rpm.html#rpm-repo1.下载并安装公共签名密钥rpm--importhttps://artifacts.elastic.co/GPG-KEY-elasticsearch......
  • podman 安装 MySQL8
    如何在测试环境下,快速创建一个MySQL环境呢?容器化是个不错的选择。拉取MySQL镜像[root@node11~]#podmanpullmysql✔docker.io/library/mysql:latestTryingtopu......
  • deepin国产操作系统 nvidia-docker2 的安装
       ======================================  平时偶尔使用deepin系统,突然有个 nvidia-docker的程序需要运行,平时工作都是在用Ubuntu,所以对deepin安装docker......
  • Linux使用 RPM 安装 Logstash
    参考网站:https://www.elastic.co/guide/en/logstash/8.5/installing-logstash.html#_yum1.下载并安装公共签名密钥rpm--importhttps://artifacts.elastic.co/GPG-KEY-......
  • OEL 5.11安装oracle 10.2.0.1
    文档课题:OEL5.11安装oracle10.2.0.1系统:oel5.1164位数据库:oracle10.2.0.164位软件包名称:10201_database_linux_x86_64.cpio.gz1、安装准备1.1、系统信息[root@leo-10g......
  • 解决CentOS 7 最小化安装后无ifconfig命令
    需求:在我们给服务器安装新系统后(centos7),由于是最小化安装,许多工具包并没有安装上,而是需要自己手动去安装,ifconfig这条命令就是需要手动安装。ifconfig是我们平时查看IP地......
  • go环境搭建及tjfoc-gm安装
    go环境搭建及tjfoc-gm安装一、环境配置1首先进入usr/local文件夹,下载go语言环境配置压缩包wgethttps://dl.google.com/go/go1.19.3.linux-amd64.tar.gz2配置......
  • 安装WSL2 (以Ubuntu的安装为例)
    使用wsl2原因:内存开销比vm小很多,启动还很快进入微软自带应用商店下载ubuntu,完成后打开,设置账户。因为默认是安装在C盘中的,如果想要迁移位置,打开cmd,执行以下命令#查......
  • win10安装wsl1的ubuntu18.04
    1.需求主系统:win10子系统:ubuntu18.04,要求wsl1,并且系统默认登录账户为没有密码的root根账户2.步骤(1)启用“适用于Linux的Windows子系统”可选功能在Windows中修改......
  • Kubeadm高可用安装k8s集群-补充说明
    1.1k8s1.24管理用户无token处理1.24版本及以上关闭了自动生成admin-user-token的配置[root@k8s-master01dashboard]#kubectl-nkube-systemgetsecret|grepadmi......