Coder Social home page Coder Social logo

ibn-net's People

Contributors

xingangpan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ibn-net's Issues

Crop size for Semantic Segmentation with IBN-Net

Hello,

I was wondering about the crop size for training the IBN-Net on the GTA5 dataset for semantic segmentation.

You state in the paper that you first resize the images to 1024 x 563 and then apply random crops for additional augmentation, but you do not clearly state the random crop size.

Thank you,
Eduard

应该把哪些BN层替换为IBN

论文里是bottleneck的第一个1x1后的BN层,然而bottleneck里有3个BN层,可选择性非常多。只能通过实验确定替换哪些是合适的选择,还是可以有理论依据?
论文中只做了第一个(a),和第一个+第二个(ax2)的实验,有没有做其他的替换组合?

Request more variants such as ResNet-18

Hello,

Would it be possible for you to add more variants to mimic the ResNet architecture provided by pytorch? This enables us to perform principled comparisons on different levels of complexity. Excited to follow your work.

Segmentation implementation

Hi, Nice work!

I have a question, Would you mind sharing what decoder or upsampling method you are using in semantic segmentation, after setting the IBN nets as the backbone?

Or could you share more about the implementation details on this? (finetuning in cityscapes and cross domain Experiments) As you didn't mention much in the paper

Question about the scale and shift operation in Instance normalization layer.

Hi, I tried to replace the Instance normalization (IN) layer with "MVN_layer + Scale_layer" in caffe as in issue (#4), but found the network hard to converge. When i remove every scale layer following MVN(i.e. use MVN layer only), the network converges.
My question is:
If i replace IN with MVN layers only in caffe, does it hurt the generalization or transfer ability of IBN-Net, or is the scale layer really important?
what makes the net hard to converge when MVN layer is followed by scale layers?
thanks again!

How to use res50 model retrain res50-ibna?

### There are instance norm in IBN models, how to use res50 model retrain res50-ibna?

File "/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 719, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for ResNet:
Missing key(s) in state_dict: "layer1.0.bn1.IN.weight", "layer1.0.bn1.IN.bias", "layer1.0.bn1.BN.weight", "layer1.0.bn1.BN.bias", "layer1.0.bn1.BN.running_mean", "layer1.0.bn1.BN.running_var", "layer1.1.bn1.IN.weight", "layer1.1.bn1.IN.bias", "layer1.1.bn1.BN.weight", "layer1.1.bn1.BN.bias", "layer1.1.bn1.BN.running_mean", "layer1.1.bn1.BN.running_var", "layer1.2.bn1.IN.weight", "layer1.2.bn1.IN.bias", "layer1.2.bn1.BN.weight", "layer1.2.bn1.BN.bias", "layer1.2.bn1.BN.running_mean", "layer1.2.bn1.BN.running_var", "layer2.0.bn1.IN.weight", "layer2.0.bn1.IN.bias", "layer2.0.bn1.BN.weight", "layer2.0.bn1.BN.bias", "layer2.0.bn1.BN.running_mean", "layer2.0.bn1.BN.running_var", "layer2.1.bn1.IN.weight", "layer2.1.bn1.IN.bias", "layer2.1.bn1.BN.weight", "layer2.1.bn1.BN.bias", "layer2.1.bn1.BN.running_mean", "layer2.1.bn1.BN.running_var", "layer2.2.bn1.IN.weight", "layer2.2.bn1.IN.bias", "layer2.2.bn1.BN.weight", "layer2.2.bn1.BN.bias", "layer2.2.bn1.BN.running_mean", "layer2.2.bn1.BN.running_var", "layer2.3.bn1.IN.weight", "layer2.3.bn1.IN.bias", "layer2.3.bn1.BN.weight", "layer2.3.bn1.BN.bias", "layer2.3.bn1.BN.running_mean", "layer2.3.bn1.BN.running_var", "layer3.0.bn1.IN.weight", "layer3.0.bn1.IN.bias", "layer3.0.bn1.BN.weight", "layer3.0.bn1.BN.bias", "layer3.0.bn1.BN.running_mean", "layer3.0.bn1.BN.running_var", "layer3.1.bn1.IN.weight", "layer3.1.bn1.IN.bias", "layer3.1.bn1.BN.weight", "layer3.1.bn1.BN.bias", "layer3.1.bn1.BN.running_mean", "layer3.1.bn1.BN.running_var", "layer3.2.bn1.IN.weight", "layer3.2.bn1.IN.bias", "layer3.2.bn1.BN.weight", "layer3.2.bn1.BN.bias", "layer3.2.bn1.BN.running_mean", "layer3.2.bn1.BN.running_var", "layer3.3.bn1.IN.weight", "layer3.3.bn1.IN.bias", "layer3.3.bn1.BN.weight", "layer3.3.bn1.BN.bias", "layer3.3.bn1.BN.running_mean", "layer3.3.bn1.BN.running_var", "layer3.4.bn1.IN.weight", "layer3.4.bn1.IN.bias", "layer3.4.bn1.BN.weight", "layer3.4.bn1.BN.bias", "layer3.4.bn1.BN.running_mean", "layer3.4.bn1.BN.running_var", "layer3.5.bn1.IN.weight", "layer3.5.bn1.IN.bias", "layer3.5.bn1.BN.weight", "layer3.5.bn1.BN.bias", "layer3.5.bn1.BN.running_mean", "layer3.5.bn1.BN.running_var".
Unexpected key(s) in state_dict: "layer1.0.bn1.running_mean", "layer1.0.bn1.running_var", "layer1.0.bn1.weight", "layer1.0.bn1.bias", "layer1.1.bn1.running_mean", "layer1.1.bn1.running_var", "layer1.1.bn1.weight", "layer1.1.bn1.bias", "layer1.2.bn1.running_mean", "layer1.2.bn1.running_var", "layer1.2.bn1.weight", "layer1.2.bn1.bias", "layer2.0.bn1.running_mean", "layer2.0.bn1.running_var", "layer2.0.bn1.weight", "layer2.0.bn1.bias", "layer2.1.bn1.running_mean", "layer2.1.bn1.running_var", "layer2.1.bn1.weight", "layer2.1.bn1.bias", "layer2.2.bn1.running_mean", "layer2.2.bn1.running_var", "layer2.2.bn1.weight", "layer2.2.bn1.bias", "layer2.3.bn1.running_mean", "layer2.3.bn1.running_var", "layer2.3.bn1.weight", "layer2.3.bn1.bias", "layer3.0.bn1.running_mean", "layer3.0.bn1.running_var", "layer3.0.bn1.weight", "layer3.0.bn1.bias", "layer3.1.bn1.running_mean", "layer3.1.bn1.running_var", "layer3.1.bn1.weight", "layer3.1.bn1.bias", "layer3.2.bn1.running_mean", "layer3.2.bn1.running_var", "layer3.2.bn1.weight", "layer3.2.bn1.bias", "layer3.3.bn1.running_mean", "layer3.3.bn1.running_var", "layer3.3.bn1.weight", "layer3.3.bn1.bias", "layer3.4.bn1.running_mean", "layer3.4.bn1.running_var", "layer3.4.bn1.weight", "layer3.4.bn1.bias", "layer3.5.bn1.running_mean", "layer3.5.bn1.running_var", "layer3.5.bn1.weight", "layer3.5.bn1.bias".

seresnext ibn occur memory leak

Hi @XingangPan thank you for share awesome repo, and one question, i have tried seresnext ibn series, but all of seresnext ibn occur memory leak, when i just replace model to resnet ibn, it work well, can you explained it plz? thank you again

RuntimeError: Error(s) in loading state_dict for ResNet:

 非常感谢您做出的贡献!
 我运行下面代码导入预训练好的Restnet50_ibn_a模型时,

from models.imagenet.resnet_ibn_a import *
###设置超参
model_resnet50_ibn_a = resnet50_ibn_a()

# Print model's state_dict
#print("Model's state_dict:")
#for param_tensor in model_resnet50_ibn_a.state_dict():
#   print(param_tensor, "\t", model_resnet50_ibn_a.state_dict()[param_tensor].size())

# 加载预先训练好的模型    
checkpoint = torch.load("./pretrained/resnet50_ibn_a.pth.tar")
model_resnet50_ibn_a.load_state_dict(checkpoint['state_dict'])

 出现了以下错误:

~/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
    721         if len(error_msgs) > 0:
    722             raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
--> 723                                self.__class__.__name__, "\n\t".join(error_msgs)))
    724 
    725     def _named_members(self, get_members_fn, prefix='', recurse=True):

RuntimeError: Error(s) in loading state_dict for ResNet:
	Missing key(s) in state_dict: "conv1.weight", "bn1.weight", "bn1.bias",

 请问我操作步骤是不是有问题?您能看看有什么解决办法吗?

ibn-b

Hi,i train the ibn-b, but it does not perform better than resnet.

IncompatibleKeys(missing_keys=[], unexpected_keys=[])

Hi, I want to apply IBN model as a part of a large model.
load_state_dict seems to work fine without throwing errors, yet it triggers an error when I want to print the net.

class LargeModel(nn.Module):
    def __init__(self, pretrain=True):
        super(LargeModel, self).__init__()

        # define ibn_model and initilize it with pretrained model.
        IBN_model_name = 'resnet50_ibn_a.pth.tar'
        IBN_model = resnet50_ibn_a(pretrained=False)
        pretrained_model_weight = torch.load(IBN_model_name)['state_dict']
        new_state_dict = OrderedDict()
        for k, v in pretrained_model_weight.items():
            name = k[7:] # remove `module.`
            new_state_dict[name] = v

        self.ibn_res50 = IBN_model.load_state_dict(new_state_dict)
        print(self.ibn_res50)
         # Define Extra layers and initilize them with uniform distribution

KeyError: 'module name can\'t contain "."'

File "/home/gyc/Ranked_Person_ReID-master/modeling/backbones/densenet121_ibn_a.py", line 41, in densenet121_ibn_a
**kwargs)
File "/home/gyc/Ranked_Person_ReID-master/modeling/backbones/densenet121_ibn_a.py", line 168, in init
bn_size=bn_size, growth_rate=growth_rate, drop_rate=drop_rate, ibn=ibn)
File "/home/gyc/Ranked_Person_ReID-master/modeling/backbones/densenet121_ibn_a.py", line 117, in init
layer = _DenseLayer(num_input_features + i * growth_rate, growth_rate, bn_size, drop_rate, True)
File "/home/gyc/Ranked_Person_ReID-master/modeling/backbones/densenet121_ibn_a.py", line 93, in init
self.add_module('norm.1', BNIN(num_input_features)),
File "/home/gyc/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 178, in add_module
raise KeyError("module name can't contain "."")

Some questions about Pretrained models.

  1. The pretrained models you have provided are compressed file, but it cannot be decompressed. And Pytorch can't directly get parameters.
    2.def resnet101_ibn_a(pretrained=False, modelpath='./models', **kwargs):
    """Constructs a ResNet-101 model.

    Args:
    pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = ResNet(Bottleneck, [3, 4, 23, 3], **kwargs)
    if pretrained:
    model.load_state_dict(model_zoo.load_url(model_urls['resnet101']))
    return model
    This function which in resnet_ibn_a.py conclude a dict model_urls,but model_ulrs['resnet101'] is a url which is a resnet101 pretrained models not the resnet101-ibn-net pretrained model.
    So I want to ask you for some methods to used IBN-Net pretrained models.Thanks !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.