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
Hello,
The Feature extraction doesn't work anymore.
Probably because they changed the names of the Layers.
Unfortantly it doesn't work with anny of the models.
Can someone help with one Model?
For now I just want to get the code running, so I don't care what Model will be working ;-)
This is the Full Error Message: /home/user/pspnet_pytorch/lib/python3.5/site-packages/torchvision/models/densenet.py:212: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaiming_normal_. nn.init.kaiming_normal(m.weight.data) Traceback (most recent call last): File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/train.py", line 101, in <module> train() File "/home/user/pspnet_pytorch/lib/python3.5/site-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/home/user/pspnet_pytorch/lib/python3.5/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/home/user/pspnet_pytorch/lib/python3.5/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/user/pspnet_pytorch/lib/python3.5/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/train.py", line 57, in train net, starting_epoch = build_network(snapshot, backend) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/train.py", line 31, in build_network net = models[backend]() File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/train.py", line 19, in <lambda> 'densenet': lambda: PSPNet(sizes=(1, 2, 3, 6), psp_size=1024, deep_features_size=512, backend='densenet'), File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/pspnet.py", line 47, in __init__ self.feats = getattr(extractors, backend)(pretrained) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/extractors.py", line 330, in densenet return DenseNet(pretrained=pretrained) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/extractors.py", line 230, in __init__ bn_size=bn_size, growth_rate=growth_rate, drop_rate=drop_rate) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/extractors.py", line 187, in __init__ layer = _DenseLayer(num_input_features + i * growth_rate, growth_rate, bn_size, drop_rate) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/extractors.py", line 166, in __init__ self.add_module('norm.1', nn.BatchNorm2d(num_input_features)), File "/home/user/pspnet_pytorch/lib/python3.5/site-packages/torch/nn/modules/module.py", line 178, in add_module raise KeyError("module name can't contain \".\"") KeyError: 'module name can\'t contain "."'
The text was updated successfully, but these errors were encountered:
@TimDNN well yes. As ResNet (extractor) architecture has been modified a bit in the pytorch git.
So, I wrote my own code to load weights which fits with the layer name and ignore the weights for the layers which are not available.
Or you can just update the code of extractors.py from here.
Hello,
The Feature extraction doesn't work anymore.
Probably because they changed the names of the Layers.
Unfortantly it doesn't work with anny of the models.
Can someone help with one Model?
For now I just want to get the code running, so I don't care what Model will be working ;-)
This is the Full Error Message:
/home/user/pspnet_pytorch/lib/python3.5/site-packages/torchvision/models/densenet.py:212: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaiming_normal_. nn.init.kaiming_normal(m.weight.data) Traceback (most recent call last): File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/train.py", line 101, in <module> train() File "/home/user/pspnet_pytorch/lib/python3.5/site-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/home/user/pspnet_pytorch/lib/python3.5/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/home/user/pspnet_pytorch/lib/python3.5/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/user/pspnet_pytorch/lib/python3.5/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/train.py", line 57, in train net, starting_epoch = build_network(snapshot, backend) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/train.py", line 31, in build_network net = models[backend]() File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/train.py", line 19, in <lambda> 'densenet': lambda: PSPNet(sizes=(1, 2, 3, 6), psp_size=1024, deep_features_size=512, backend='densenet'), File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/pspnet.py", line 47, in __init__ self.feats = getattr(extractors, backend)(pretrained) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/extractors.py", line 330, in densenet return DenseNet(pretrained=pretrained) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/extractors.py", line 230, in __init__ bn_size=bn_size, growth_rate=growth_rate, drop_rate=drop_rate) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/extractors.py", line 187, in __init__ layer = _DenseLayer(num_input_features + i * growth_rate, growth_rate, bn_size, drop_rate) File "/home/user/PycharmProjects/pspnet_pytorch/pspnet-pytorch-master/extractors.py", line 166, in __init__ self.add_module('norm.1', nn.BatchNorm2d(num_input_features)), File "/home/user/pspnet_pytorch/lib/python3.5/site-packages/torch/nn/modules/module.py", line 178, in add_module raise KeyError("module name can't contain \".\"") KeyError: 'module name can\'t contain "."'
The text was updated successfully, but these errors were encountered: