Git Product home page Git Product logo

Comments (2)

oliver8459 avatar oliver8459 commented on August 15, 2024

I used 4 tesla v100(32G) gpus, batch_size=14(16 is OOM) to reproduce Dog and kept the same config with your paper, but the acc is only 90.5, a big difference from the paper 92.3.

from transfg.

oliver8459 avatar oliver8459 commented on August 15, 2024

I used 4 tesla v100(32G) gpus, batch_size=14(16 is OOM) to reproduce Dog and kept the same config with your paper, but the acc is only 90.5, a big difference from the paper 92.3.

Hi Oliver, just wondering if you can share your pretrained model with me? Thanks in advance!

Thanks for your reply, i use the pretrained model "VIT_B16" downloaded from your link. By the way, i removed the "part_select" and "part_layer"(like pure vit), the performance is similar with TransFG which i reproduced 90.5.

`
class Encoder(nn.Module):
def init(self, config):
super(Encoder, self).init()
self.layer = nn.ModuleList()
for _ in range(config.transformer["num_layers"] - 1):
layer = Block(config)
self.layer.append(copy.deepcopy(layer))
# self.part_select = Part_Attention()
# self.part_layer = Block(config)
self.part_norm = LayerNorm(config.hidden_size, eps=1e-6)

def forward(self, hidden_states):
    # attn_weights = []
    for layer in self.layer:
        hidden_states, _ = layer(hidden_states)
        # attn_weights.append(weights)            
    # part_num, part_inx = self.part_select(attn_weights)
    # part_inx = part_inx + 1
    # parts = []
    # B, num = part_inx.shape
    # for i in range(B):
    #     parts.append(hidden_states[i, part_inx[i,:]])
    # parts = torch.stack(parts).squeeze(1)
    # concat = torch.cat((hidden_states[:,0].unsqueeze(1), parts), dim=1)
    # part_states, part_weights = self.part_layer(concat)
    # part_encoded = self.part_norm(part_states)  
    part_encoded = self.part_norm(hidden_states) 

    return part_encoded

`

from transfg.

Related Issues (20)

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.