xingangpan / ibn-net Goto Github PK
View Code? Open in Web Editor NEWInstance-Batch Normalization Networks (ECCV2018)
License: MIT License
Instance-Batch Normalization Networks (ECCV2018)
License: MIT License
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
hi, do you have the senet50 pertained model?
Hi, do you do experiments in some other networks, such as vgg? or ibn-net is particularly designed for resnet network? thank you
Hello, I used your resnet50 with ibna added, and the performance on the mixed data set is significantly reduced. What is the reason for this? The data set is multiple person reID data sets
Hi,i train the ibn-b, but it does not perform better than resnet.
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 "."")
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
### 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".
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
Is IBN layer just "MVN_layer in caffe"?
Thank you very much!
folllowing the download link, I can't archive the tar files. Does anybody come across this problem?
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
论文里是bottleneck的第一个1x1后的BN层,然而bottleneck里有3个BN层,可选择性非常多。只能通过实验确定替换哪些是合适的选择,还是可以有理论依据?
论文中只做了第一个(a),和第一个+第二个(ax2)的实验,有没有做其他的替换组合?
RT, thanks !
下载resnet101_ibn_a.pth.tar之后解压不了,提示数据损坏,能否直接提供.pth文件
I want to use this repo to generate drivable area,how could I deal with the data?
非常感谢您做出的贡献!
我运行下面代码导入预训练好的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",
请问我操作步骤是不是有问题?您能看看有什么解决办法吗?
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.
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!
flake8 testing of https://github.com/XingangPan/IBN-Net on Python 3.7.0
$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
./imagenet.py:250:63: E999 SyntaxError: invalid syntax
inputs, targets = inputs.cuda(), targets.cuda(async=True)
^
1 E999 SyntaxError: invalid syntax
1
Hello.
Would it be possible to provide pre-trained models of ibn_b? Especially, I would like to use resnet101_ibn_b for my work.
Can you provide some detailed source codes related to this section (i.e., your Fig. 5.)
Hello! Does IBN-Net can improve generalization on the generative model? Have you ever done any tests on GAN?
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 !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.