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

Problem to reproduce the example #6

Open
matteuscruz opened this issue Sep 23, 2024 · 1 comment
Open

Problem to reproduce the example #6

matteuscruz opened this issue Sep 23, 2024 · 1 comment

Comments

@matteuscruz
Copy link

I receiving the following error:

TypeError: ProxSGD_VR.step() got multiple values for argument 'variance_buffer'

@wenh06
Copy link
Owner

wenh06 commented Sep 25, 2024

Which example did you run when encountering this error? I'm not able to reproduce it, the following code runs without raising such error:

import torch

from fl_sim.models import ResNet10
from fl_sim.optimizers.base import ProxSGD_VR

model = ResNet10(10)
optim = ProxSGD_VR(model.parameters())
model_cache = ResNet10(10)
criterion = torch.nn.CrossEntropyLoss()

images, labels = torch.rand((2,3,224,224)), torch.tensor([2,4])
loss = criterion(model(images), labels)
loss.backward()
optim.step(local_weights=model_cache.parameters())
print("Test passed")

image

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

2 participants