doantienthongbku / Implementation-patchnet

48 stars 10 forks source link

shape not matched #1

Open LeeKyungwook opened 1 year ago

LeeKyungwook commented 1 year ago

Thanks for Great code.

I found some errors. After inference network, shape is not matched with fc layer in loss. In loss func, fc layer need 1024 in features, but shape is not 1024. Can you check it?? Thx

TangDL commented 1 year ago

just change it to 512

swhoosh commented 1 year ago

@TangDL I also encountered this problem. Can you please tell me where can I change the feature size? I am very new to pytorch and NN. Thanks

wlz987 commented 1 year ago

Thanks for Great code.

I found some errors. After inference network, shape is not matched with fc layer in loss. In loss func, fc layer need 1024 in features, but shape is not 1024. Can you check it?? Thx loss.py里面,把1024改成512 class PatchLoss(nn.Module):

def __init__(self, alpha1=1.0, alpha2=1.0):
    super().__init__()
    self.alpha1 = alpha1
    self.alpha2 = alpha2
    self.sim_loss = SimilarityLoss()
    self.amsm_loss = AdMSoftmaxLoss(512, 2)