You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your outstanding work. I want to recover the data under PRECODE defense with ROG. But when I change the LeNet to LeNetVB like the model in PRECODE, the code always reports bugs that RuntimeError: size mismatch, got input (16), mat (16x256), vec (512)
Traceback (most recent call last):
File "/data2/chenxiang/svd_defense/rog/attack_fedavg.py", line 7, in <module>
main("config_fedavg.yaml",int(sys.argv[1]))
File "/data2/chenxiang/svd_defense/rog/main.py", line 87, in main
recon_data = grad_inv(attacker, grad, x, onehot, model, config, logger)
File "/data2/chenxiang/svd_defense/rog/src/attack/attacker.py", line 269, in grad_inv
dummy_data = attacker.multistep_attack(grad, x, onehot, model, config.tau, logger)
File "/data2/chenxiang/svd_defense/rog/src/attack/attacker.py", line 235, in multistep_attack
dummy_data_optimizer.step(closure)
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/optim/lr_scheduler.py", line 75, in wrapper
return wrapped(*args, **kwargs)
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/optim/optimizer.py", line 385, in wrapper
out = func(*args, **kwargs)
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/optim/optimizer.py", line 76, in _use_grad
ret = func(self, *args, **kwargs)
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/optim/adam.py", line 146, in step
loss = closure()
File "/data2/chenxiang/svd_defense/rog/src/attack/attacker.py", line 209, in closure
pred = meta_net(F.interpolate(dummy_data, scale_factor=self.sf, mode='bicubic'))
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/data2/chenxiang/svd_defense/rog/networks/metanet.py", line 83, in forward
output = self.net(inputs)
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/data2/chenxiang/svd_defense/rog/networks/vgg.py", line 189, in forward
x = self.VB(x)
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/data2/chenxiang/svd_defense/rog/networks/precodenet/VariationalBlock.py", line 59, in forward
x = self.decoder(encoding.unsqueeze(0))
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/chenxiang/anaconda3/envs/svd/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
RuntimeError: size mismatch, got input (16), mat (16x256), vec (512)
I have checked the tensor size and layer size. By the way, the vgg7_vb in your code is vgg7, so there is no example I could learn.
The text was updated successfully, but these errors were encountered:
Thank you for your outstanding work. I want to recover the data under PRECODE defense with ROG. But when I change the LeNet to LeNetVB like the model in PRECODE, the code always reports bugs that RuntimeError: size mismatch, got input (16), mat (16x256), vec (512)
I have checked the tensor size and layer size. By the way, the vgg7_vb in your code is vgg7, so there is no example I could learn.
The text was updated successfully, but these errors were encountered: