baadd icon indicating copy to clipboard operation
baadd copied to clipboard

requiry about the weight of DD

Open wuyu-1 opened this issue 1 year ago • 2 comments

When I run backdoor on DD, I cannot return the weights of the models. And when I use the saved dataset to evaluate it again, I cannot get the same results as the training log.

wuyu-1 avatar Dec 03 '23 12:12 wuyu-1

No, you can't directly return any weights because the DD code splits the weights into a list. I think this is because they use a very early version of PyTorch.

liuyugeng avatar Dec 03 '23 13:12 liuyugeng

I think the parameters are saved in the results.pth. You can load it as the step.

For instance,

steps = torch.load(os.path.join(data_path, 'results.pth'))
steps = [(d.to(state.device), l.to(state.device), lr.to(state.device)) for (d, l, lr) in steps]

And evaluate it by using this.

liuyugeng avatar Dec 03 '23 13:12 liuyugeng