torchvision VGG model
LiuXiaoxuanPKU opened this issue · 2 comments
LiuXiaoxuanPKU commented
Thanks for the repo! I'm playing with pytorch-memonger+VGG16. However, it seems not work.
Reproduce:
vgg16 = models.vgg16() # Get model from torchvision.models
vgg16.features = SublinearSequential(*list(vgg16.features.children())). # Just replace features with SublinearSequential
data = torch.randn((batch_size, 3, 224, 224), requires_grad=True).cuda() # turn on requires_grad to enable torch.autograd.backward in CheckpointFunction
label = torch.randint(0, 1000, (batch_size,)).cuda()
# start training
for iter in range(10):
output = vgg16(data)
loss = criterion(output, label)
optimizer.zero_grad()
loss.backward()
optimizer.step()
Error message: RuntimeError: a leaf Variable that requires grad is being used in an in-place operation.
All the relu in torchvision VGG16 uses in-place operations, not sure why it does not work when introducing memoger. Any comments/fixes would be greatly appreciated, thanks!
stale commented
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
stale commented
Close due to inactivity. Feel free to re-open it if necessary.