Git Product home page Git Product logo

attention_branch_network's People

Contributors

hiroshi-fukui avatar thirakawa 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

attention_branch_network's Issues

set manualSeed invalid

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.

AttributeError: 'list' object has no attribute 'cpu'

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.

Using pretrained model

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.

Models for ImageNet

コードの共有をいただきありがとうございます。

ImageNetでpre-train済みのモデルを使って推論を試してみようと思ったのですが、モデル(ResNet50/101/152)のpythonファイルがmodels/imagenet以下に見当たりません(models/imagenet以下にあるresnext.pyで定義されているモデルもforwardではアテンションマップを返していないように見えます)。

公開いただいているImageNetのpre-trainモデルをロードして推論を行いたい場合、どのpythonファイルで定義されているネットワークに対して、pre-trainモデルをロードすればよろしいでしょうか?

can not achieve the same performance

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 ?

The difference between the paper and the code for Attention branch

論文と実際のコード(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となっております。
image

私の勘違いであれば申し訳ございません。
お忙しいところ恐縮ですが、ご確認いただければ幸いです。
何卒宜しくお願い致します。

How did you fuse your attention maps and feature maps for training?

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

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.