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

Some remaining questions with fine-pruning-celeba.py #6

Open
HazardFY opened this issue Nov 4, 2021 · 0 comments
Open

Some remaining questions with fine-pruning-celeba.py #6

HazardFY opened this issue Nov 4, 2021 · 0 comments

Comments

@HazardFY
Copy link

HazardFY commented Nov 4, 2021

Thanks for your answers. For the first question before, I find that I didn't download the latest version of the code. But I still have some questions about https://github.com/VinAIResearch/Warping-based_Backdoor_Attack-release/tree/main/defenses/fine_pruning/fine-pruning-celeba.py

  1. https://github.com/VinAIResearch/Warping-based_Backdoor_Attack-release/blob/main/defenses/fine_pruning/fine-pruning-celeba.py#L83 opt.input_width is not assigned.
  2. When I apply the fine_pruning method in ResNet50, I find that I have to redefine the last bn layer with code nn.BatchNorm2d(pruning_mask.shape[0] - num_pruned) and then load the bn's params data in the way of https://github.com/VinAIResearch/Warping-based_Backdoor_Attack-release/blob/main/defenses/fine_pruning/fine-pruning-celeba.py#L150](url). Otherwise, the output of redefined last conv layer doesn't match the dimension of input of the last bn layer. Finally before using net_pruned in the eval function, I used net_pruned.eval() to fix params of the redefined last bn layer.(The Resnet50 which I used is torchvision.models.resnet50(), so the dimension of the concrete layer may be different, but I think redefining bn layer perhaps is also needed in your code)
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