当前位置:网站首页>pytorch的安装注意事项
pytorch的安装注意事项
2022-07-30 23:22:00 【风华明远】
pytorch的官方下载地址是:
https://download.pytorch.org/whl/torch_stable.html
需要安装的是torch、torchvision。版本分为支持cpu和gpu的,而且很多,需要注意寻找。
安装命令是
pip install torch-1.10.0+cu113-cp39-cp39-win_amd64.whl
pip install torchvision-0.12.0+cpu-cp39-cp39-win_amd64.whl
需要注意的是torch和torchvision的版本是不一样的。这是第一个坑。由于torch包很大,建议先安装torchvision,确认版本后再下载torch。
第二个坑是使用tensorboard会出现错误。网络上给出的方法是使用旧版本的setuptool。这个方法不可取。不如修改tensorboard的init.py文件:
import tensorboard
#from setuptools import distutils
from distutils import version as vvv
#LooseVersion = distutils.version.LooseVersion
LooseVersion = vvv.LooseVersion
if not hasattr(tensorboard, '__version__') or LooseVersion(tensorboard.__version__) < LooseVersion('1.15'):
raise ImportError('TensorBoard logging requires TensorBoard version 1.15 or above')
#del distutils
del vvv
del LooseVersion
del tensorboard
from .writer import FileWriter, SummaryWriter # noqa: F401
from tensorboard.summary.writer.record_writer import RecordWriter # noqa: F401
直接使用distutils包。
第三个坑是ssl链接。因为证书的事情会导致ssl链接失败。方法是修改ssl.py文件:
#_create_default_https_context = create_default_context
_create_default_https_context = _create_unverified_context
在805行处。不使用create_default_context 而是使用_create_unverified_context。
第四个坑是关于cuda的。估计每个初学者都会碰到。我是在安装tensorflow的时候就遇到了。这次很顺利,没有遇到麻烦。
没想到tensorflow衰落的这么快。我还写了很多东西,现在要从头开始学习pytorch了。程序员是一个苦活,因为有学不完的新东西。
边栏推荐
- 打动中产精英群体,全新红旗H5用产品力跑赢需求
- EasyExcel comprehensive course combat
- Chevrolet Trailblazer, the first choice for safety and warmth for your family travel
- Manually set transaction commit in mysql
- grub learning
- 二叉查找树的定义,查找,插入,删除
- In MySQL, the stored procedure cannot realize the problem of migrating and copying the data in the table
- flutter 做底部的三个按键,有叠加,有填充
- ZZULIOJ:1119: sequence order
- mysql获取近7天,7周,7月,7年日期,根据当前时间获取近7天,7周,7月,7年日期
猜你喜欢

【MySQL】Mysql事务以及权限管理

【MySQL】MySQL中对数据库及表的相关操作

Chevrolet Trailblazer, the first choice for safety and warmth for your family travel

reindex win10

MySQL联合查询(多表查询)

The difference between ?? and ??= and ?. and || in JS

Golang go-redis cluster模式下不断创建新连接,效率下降问题解决

【LeetCode】42. 接雨水 - Go 语言题解
![[MySQL] Related operations on databases and tables in MySQL](/img/a5/c92e0404c6a970a62595bc7a3b68cd.gif)
[MySQL] Related operations on databases and tables in MySQL

# Dasctf 7月赋能赛 WP
随机推荐
Golang go-redis cluster模式下不断创建新连接,效率下降问题解决
二叉查找树的定义,查找,插入,删除
win10重建索引
go版本升级
智能创意中的尺寸拓展模块
Excel基础学习笔记
Chapter 8 Intermediate Shell Tools II
Go语学习笔记 - gorm使用 - 事务操作 Web框架Gin(十一)
leetcode 406. Queue Reconstruction by Height 根据身高重建队列(中等)
Debezium error series 20: task failed to create new topic. Ensure that the task is authorized to create topics
DFS question list and template summary
uniapp develops WeChat applet - soft exam brushing applet
2022中国物流产业大会暨企业家高峰论坛在杭州举办!
MySQL进阶sql性能分析
详解操作符
Debezium报错系列之二十:task failed to create new topic.Ensure that the task is authorized to create topics
# Dasctf 7月赋能赛 WP
Excel basic study notes
leetcode 406. Queue Reconstruction by Height 根据身高重建队列(中等)
2022 Nioke Summer Multi-School Training Camp 1 J Serval and Essay