当前位置:网站首页>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.whl
It 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: F401
Use 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_context
At 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.
边栏推荐
- PyTorch模型导出到ONNX文件示例(LeNet-5)
- Reverse linked list - head insertion inversion method
- HCIP第十五天笔记
- 从编译的角度来学作用域!
- ZZULIOJ:1119: 数列有序
- "Wei cup" school more than 2022 cattle summer camp 4 Nancy (polocy) pelosi article variance law of Arts
- Computer shortcut icon whitening solution
- 一款好用的接口测试工具——Postman
- 通过对抗性知识蒸馏压缩深度图神经网络
- HashSet源码解析
猜你喜欢
随机推荐
PS基础学习(一)
HF2022-EzPHP reproduction
CPM:A large-scale generative chinese pre-trained lanuage model
MPI简谈
“蔚来杯“2022牛客暑期多校训练营4 N.Particle Arts 规律 方差
【LeetCode】70. 爬楼梯 - Go 语言题解
# Dasctf 7月赋能赛 WP
uni-ui安装
“蔚来杯“2022牛客暑期多校训练营2 H.Take the Elevator
uniapp开发微信小程序-软考刷题小程序
C# VSCode & Rider引用命名空间快捷键
The difference between ?? and ??= and ?. and || in JS
借助深度估计的点云场景重建
Lambda表达式
HCIP第十六天笔记
Day016 类和对象
Detailed operator
Flex布局使用
leetcode:127. Word Solitaire
HF2022-EzPHP复现