-
Notifications
You must be signed in to change notification settings - Fork 20
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
RuntimeError: running_mean should contain 57 elements not 64 #6
Comments
When you prune a convolutional layer, you also need to prune the following batchnorm layer. You can see an example of this here: pytorch-prunes/models/wideresnet.py Line 205 in bc85a5c
|
------------------------------------------------------------------------------Copyright (c) MicrosoftLicensed under the MIT License.Written by Bin Xiao ([email protected])Modified by Xingyi Zhou------------------------------------------------------------------------------from future import absolute_import import torch def conv3x3(in_planes, out_planes, stride=1): class BasicBlock(nn.Module):
class Identity(nn.Module):
class Zero(nn.Module):
class ZeroMake(nn.Module):
class MaskBlock(nn.Module):
class PoseResNet(nn.Module):
def get_pose_net(num_layers, heads, head_conv,mask=False):
this is my code ,can you give me some advices?? |
hi,
I success to pruned and finetune the cifar res_model,
have successed to finish the pruned model by own data and model,
but and now need to finetune the pruned model ,happened some error:
raceback (most recent call last):
File "train_fashion.py", line 155, in
log_dict_train=train(epoch,train_loader)
File "train_fashion.py", line 117, in train
log_dict_train, _ = trainer.train(epoch, train_loader)
File "/fashiontrain/fashionprunes/lib/trains/base_trainer.py", line 103, in train
return self.run_epoch('train', epoch, data_loader)
File "/fashiontrain/fashionprunes/lib/trains/base_trainer.py", line 79, in run_epoch
output, loss, loss_stats = model_with_loss(batch)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/fashiontrain/fashionprunes/lib/trains/base_trainer.py", line 19, in forward
outputs = self.model(batch['input'])
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/fashiontrain/fashionprunes/lib/models/networks/msra_resnet.py", line 372, in forward
x = self.layer1(x)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/fashiontrain/fashionprunes/lib/models/networks/msra_resnet.py", line 137, in forward
out = self.bn1(out)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/batchnorm.py", line 83, in forward
exponential_average_factor, self.eps)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py", line 1697, in batch_norm
training, momentum, eps, torch.backends.cudnn.enabled
RuntimeError: running_mean should contain 57 elements not 64
can you give me some advices??
thank you
The text was updated successfully, but these errors were encountered: