当前位置:网站首页>Installation considerations for pytorch
Installation considerations for pytorch
2022-07-30 23:34:00 【Fenghua Mingyuan】
The official download address of pytorch is:
https://download.pytorch.org/whl/torch_stable.html
Torch and torchvision need to be installed.The version is divided into support cpu and gpu, and there are many, you need to pay attention to find.
The installation command is
pip install torch-1.10.0+cu113-cp39-cp39-win_amd64.whlpip install torchvision-0.12.0+cpu-cp39-cp39-win_amd64.whlIt should be noted that the versions of torch and torchvision are different.This is the first pit.Due to the large torch package, it is recommended to install torchvision first, confirm the version and then download torch.
The second pit is that there will be errors when using tensorboard.The method given on the web is to use an older version of setuptool.This method is not advisable.It is better to modify the init.py file of tensorboard:
import tensorboard#from setuptools import distutilsfrom distutils import version as vvv#LooseVersion = distutils.version.LooseVersionLooseVersion = vvv.LooseVersionif not hasattr(tensorboard, '__version__') or LooseVersion(tensorboard.__version__) < LooseVersion('1.15'):raise ImportError('TensorBoard logging requires TensorBoard version 1.15 or above')#del distutilsdel vvvdel LooseVersiondel tensorboardfrom .writer import FileWriter, SummaryWriter # noqa: F401from tensorboard.summary.writer.record_writer import RecordWriter # noqa: F401Use the distutils package directly.
The third pit is the ssl link.Because the certificate thing will cause the ssl link to fail.The method is to modify the ssl.py file:
#_create_default_https_context = create_default_context_create_default_https_context = _create_unverified_contextAt line 805.Instead of create_default_context use _create_unverified_context.
The fourth pit is about cuda.It is estimated that every beginner will encounter it.I encountered it when I installed tensorflow.This time it went smoothly without any trouble.
I didn't expect tensorflow to decline so fast.I've also written a lot and am now learning pytorch from scratch.Programmers are hard work, because there are endless new things to learn.
边栏推荐
猜你喜欢
随机推荐
[0x800706D9] solution appears in Microsoft Store
46.<list链表的举列>
2021GDCPC广东省大学生程序设计竞赛 H.History
45.【list链表的应用】
grub 学习
PS基础学习(一)
第一节 zadig 入门
2021GDCPC广东省大学生程序设计竞赛 B.Byfibonacci
#yyds干货盘点# 面试必刷TOP101:判断链表中是否有环
mysql中关于存储过程无法实现迁移复制表中数据问题
Android安全性优化——APP加固
"Wei cup" school more than 2022 cattle summer camp 4 L.B lack Hole, computational geometry
BFS题单总结
递增三元组
天空云变化案例
详解操作符
uni-ui installation
leetcode:127. 单词接龙
$\text{ARC 145}$
The difference between ?? and ??= and ?. and || in JS







