pytorch
查无此人☞
这个作者很懒,什么都没留下…
展开
-
完美解决apex安装报错:error: command ‘gcc‘ failed with exit status 1 Running setup.py install for apex error
最近在跑swin-transformer,安装apex是出现以下错误:原因是gcc版本太低:目前的gcc版本是4.9.4解决方法,先安装较高版本的gcc,这里以安装5.2.0为例(我是在centos7下以root用户安装的,普通用户需要权限)。cd /usr/local/src# 下载gcc5.2.0源码wget http://ftp.gnu.org/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2tar -jxvf gcc-5.2.0.tar.bz2# 进入gcc目原创 2022-04-04 17:10:13 · 2729 阅读 · 1 评论 -
CosineAnnealingLR
记录一下CosineAnnealingLR调整学习率这种策略:import torchimport torch.nn as nnfrom torch.optim.lr_scheduler import CosineAnnealingLRimport itertoolsimport matplotlib.pyplot as pltinitial_lr = 0.1class model(nn.Module): def __init__(self): super().原创 2021-12-17 22:57:47 · 2847 阅读 · 0 评论 -
AttributeError: ‘_IncompatibleKeys‘ object has no attribute ‘cuda‘
elif model_type == 'swin_mlp': model = SwinMLP(img_size=config.DATA.IMG_SIZE, patch_size=config.MODEL.SWIN_MLP.PATCH_SIZE, in_chans=config.MODEL.SWIN_MLP.IN_CHANS, num_clas...原创 2021-12-13 20:35:34 · 1470 阅读 · 0 评论 -
torch.backends.cudnn.benchmark = True==cudnn安装成功?
设置 torch.backends.cudnn.benchmark=True 将会让程序在开始时花费一点额外时间,为整个网络的每个卷积层搜索最适合它的卷积实现算法,进而实现网络的加速.原创 2021-11-22 20:58:39 · 1158 阅读 · 2 评论