machine-perception-robotics-group / attention_branch_network Goto Github PK
View Code? Open in Web Editor NEWAttention Branch Network (CIFAR100, ImageNet models)
License: MIT License
Attention Branch Network (CIFAR100, ImageNet models)
License: MIT License
Hi:
I tried your code on CIFAR100 and got competitive performance. But when I used --manualSeed=10 to set the seed and used --epochs 1 to train, each time the model gives me a different result. I'm so puzzled. What can I do to make sure when I set manualSeed, I can get the same results? Thank you.
Could you please share a sample code for visualizing Attention map? I could't find it in repo.
Can you share the code on Windows ?
Hi, Thank you for sharing the good idea and code.
On CIFAR 100, how can I use the training results to visualize the sample images?
A function, "upsampling", is used in utils/visualize.py. However, there is no difinition of "upsampling". Where is it?
Hello Sir, first of all thank you for posting this project.
In your paper page 4 there are equation 1 and 2. "Equation 1 is simply a dot-product between the attention and feature maps at a specific channel c. In contrast, Eq. 2 can highlight the feature map at the peak of the attention map while preventing the lower value region of the attention map from degrading to zero."
I want to ask how they implemented in your code? Which exactly line are they?
Sincerely,
Qifeng
When I try to run the code, I download the model files on ImageNet2012 dataset from the links in readme file. But the downloaded files are corrupted. Could you please check the files in dropbox? Thank you.
https://www.dropbox.com/sh/tuo90s1uqmbk1vd/AAAksM9uPT5u-eViAe-PXIqsa?dl=0
https://www.dropbox.com/sh/8vzv7ov59xb5wle/AABaE24vo3Kc-VuSKbOUsZiua?dl=0
https://www.dropbox.com/sh/senw3akoud9cten/AACXOBuiNCWq6wPjl4EIVmhHa?dl=0
論文と実際のコード(baseline modelがResNetのもの)に細かいですが、違いがあるようにみえますので、
よろしければご確認いただけないでしょうか。該当部分は下記の通りです。
models/cifar/resnet.pyの179行目
self.att = self.sigmoid(self.bn_att3(self.att_conv3(ax)))
のself.att_conv3(ax)は、119行目で
self.att_conv3 = nn.Conv2d(num_classes, 1, kernel_size=3, padding=1, bias=False)
のようにカーネルサイズが3と定義されておりますが
論文( https://arxiv.org/pdf/1812.10025.pdf ) のFig. 2(a)のAttention branchのAttention mapを出力する方の分岐には、
1x1 conv., 1
のようにカーネルサイズが1となっております。
私の勘違いであれば申し訳ございません。
お忙しいところ恐縮ですが、ご確認いただければ幸いです。
何卒宜しくお願い致します。
コードの共有をいただきありがとうございます。
ImageNetでpre-train済みのモデルを使って推論を試してみようと思ったのですが、モデル(ResNet50/101/152)のpythonファイルがmodels/imagenet
以下に見当たりません(models/imagenet
以下にあるresnext.py
で定義されているモデルもforward
ではアテンションマップを返していないように見えます)。
公開いただいているImageNetのpre-trainモデルをロードして推論を行いたい場合、どのpythonファイルで定義されているネットワークに対して、pre-trainモデルをロードすればよろしいでしょうか?
this init file contains alexnet, vgg and preresnet imports files corresponding to which are missing. This gives an error when training cifar10.
i can not achieve the same performance of top-1 errors 22.82 in CIFAR100.
According to your script, i run the experiments of proposed abn methods and the baseline methods(resnet110), but both achieve the almost same performance 75.54, 75.35.
Is there something i missed ?
Why don't you manage your Dockerfile in this repository?
There is an obsolete bug in Dockerfile, so I want to make a PR.
Thank you for the code, I am getting this error in running the imagenet.py on my 3 class data, If I am commenting the line 326-327 and 331-352 than the code runs fine and I got the classification results. Now I want to visualize the sample images, So, I have uncommented the lines. I am getting the below error.
File "imagenet.py", line 326, in test
c_att = attention.data.cpu()
AttributeError: 'list' object has no attribute 'data'
When the same command is applied on inputs i.e.,
d_inputs = inputs.data.cpu()
d_inputs = d_inputs.numpy()
I am not getting any errors.
Please help.
I have some problem with the multi-task learning.
Hi!
I have trained ABN on custom data from scratch using the training script and steps provided -- it works fine. However, when I try to finetune pretrained ResNet models using "--pretrained" flag, it always crashes with missing key(in state_dict) error. All the missing weights seems to be from the attention layer. Has anyone faced similar issue or know how to resolve this? Thank you.
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.