Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
holyswordZZQ opened this issue Jul 1, 2023 · 1 comment

Comments

@holyswordZZQ
Copy link

          > 我也有这个问题,作者的实现的差不多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)

@holyswordZZQ
Copy link
Author

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卷积时显存占用明显变小了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant