weiaicunzai/pytorch-cifar100

> 我也有这个问题,作者的实现的差不多5个G,测试准确率有78.9, pytorch官方实现差不多1.4个G,测试集准确率也只有60%,,请问有看到问题在哪吗?

holyswordZZQ opened this issue · 1 comments

          > 我也有这个问题,作者的实现的差不多5个G,测试准确率有78.9, pytorch官方实现差不多1.4个G,测试集准确率也只有60%,,请问有看到问题在哪吗?

测试代码:

# my implementation
>>> from models.resnet import resnet50
>>> net = resnet50()
>>> sum(p.numel() for p in net.parameters())
23705252

# torchvision implementation
>>> from torchvision.models import resnet50
>>> net = resnet50()
>>> sum(p.numel() for p in net.parameters())
25557032

我和官方大小差不多 , 你是怎么测的 5gb

Originally posted by @weiaicunzai in #17 (comment)

Resnet中

self.conv1 = nn.Sequential(
            nn.Conv2d(3, 64, kernel_size=3, padding=1, bias=False),
            nn.BatchNorm2d(64),
            nn.ReLU(inplace=True))

使用了3*3卷积,会导致训练时显存占用变大。当我改回原文的7*7卷积时显存占用明显变小了