YimianDai / open-aff

code and trained models for "Attentional Feature Fusion"
729 stars 95 forks source link

TypeError: forward() missing 1 required positional argument: 'residual' #29

Open haideralimughal opened 3 years ago

haideralimughal commented 3 years ago

Hi, thanks for your outstanding work. i am trying to add your AFF module with my model decoder and unfortunately getting this error. I don't know which value should i give to residual ? or how solve this issue. Hint....

    self.AFFBlock4 = AFF(512)
    self.AFFBlock3 = AFF(256)
    self.AFFBlock2 = AFF(128)
    self.AFFBlock1 = AFF(64) 

add with decoder....

    d4 = self.decoder4(e4) + e3
    d4 = self.AFFBlock4(d4)
    d3 = self.decoder3(d4) + e2
    d3 = self.AFFBlock3(d3)
    d2 = e1 + F.upsample(self.decoder2(d3), (e1.size(2), e1.size(3)), mode='bilinear')
    #d2 = self.decoder2(d3) + e1
    d2 = self.AFFBlock2(d2)
    d1 = self.decoder1(d2) + x
    d1 = self.AFFBlock1(d1)
cbn3 commented 1 year ago

Have you solved this problem yet?

cbn3 commented 1 year ago

Thank you very much if you could help me