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

Error of Pruning #3

Closed
cliangyu opened this issue Sep 12, 2021 · 3 comments
Closed

Error of Pruning #3

cliangyu opened this issue Sep 12, 2021 · 3 comments

Comments

@cliangyu
Copy link

Hi, I encountered error in the pruning model when running on LT cifar-10. Thank you if you can help me figure it out.

My parameters:
--nproc_per_node=1 --master_port 48436 train_simCLR.py res18_scheduling_sgd_temp0.2_wd1e-4_lr0.5_b512_twolayerProj_epoch2000_split1_D_i_newNT_s10_pruneP0.9DualBN --epochs 2000 --batch_size 512 --optimizer sgd --lr 0.5 --temperature 0.2 --model res18 --trainSplit cifar10_imbSub_with_subsets/split1_D_i.npy --save-dir checkpoints --seed 10 --output_ch 128 --num_workers 8 --prune --prune_percent 0.9 --prune_dual_bn

The error message:
Traceback (most recent call last): File "/home/students/dipe051-1/workspace/code/SDCLR/train_simCLR.py", line 484, in <module> main() File "/home/students/dipe051-1/workspace/code/SDCLR/train_simCLR.py", line 396, in main train_prune(train_loader, model, optimizer, scheduler, epoch, log, args.local_rank, rank, world_size, args=args) File "/home/students/dipe051-1/workspace/code/SDCLR/prune/prune_simCLR.py", line 57, in train_prune features_2 = model(inputs_2) File "/home/students/dipe051-1/anaconda3/envs/al-ssl-3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/home/students/dipe051-1/anaconda3/envs/al-ssl-3/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 799, in forward output = self.module(*inputs[0], **kwargs[0]) File "/home/students/dipe051-1/anaconda3/envs/al-ssl-3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/home/students/dipe051-1/workspace/code/SDCLR/models/resnet_prune_multibn.py", line 443, in forward return self._forward_impl(x) File "/home/students/dipe051-1/workspace/code/SDCLR/models/resnet_prune_multibn.py", line 412, in _forward_impl x = self.conv1(x) File "/home/students/dipe051-1/anaconda3/envs/al-ssl-3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/home/students/dipe051-1/workspace/code/SDCLR/models/resnet_prune.py", line 36, in forward return self._conv_forward(input, weight) TypeError: _conv_forward() missing 1 required positional argument: 'bias'

@cliangyu
Copy link
Author

To add on, I am using torch 1.9.0

@cliangyu
Copy link
Author

return self._conv_forward(input, weight, self.bias)solved the issue. Please check and close this comment if you find this a real problem and solution. Thank you.

@geekJZY
Copy link
Collaborator

geekJZY commented Sep 12, 2021

Thanks for your interest in our work. I think this is a problem caused by the Pytorch version. This code is based on Pytorch 1.7.1.

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