wfs123456 / CCTrans

Code Reproduction
56 stars 8 forks source link

Pretrained weights for small and base #11

Closed arthuremir closed 2 years ago

arthuremir commented 2 years ago

Hi! Thanks for the awesome work!

Can you please share the pretrained weights for small and base models? Or, if you don't have them, maybe you can share the code for pretraining? It would be very helpful for me!

Thank you in advance!

wfs123456 commented 2 years ago

The pretrained weights of Twins is given in https://github.com/Meituan-AutoML/Twins, especially, ALTGVT-Small, ALTGVT-Base, ALTGVT-Large.

------------------ 原始邮件 ------------------ 发件人: "wfs123456/CCTrans" @.>; 发送时间: 2022年5月5日(星期四) 凌晨2:03 @.>; @.***>; 主题: [wfs123456/CCTrans] Pretrained weights for small and base (Issue #11)

Hi! Thanks for the awesome work!

Can you please share the pretrained weights for small and base models? Or, if you don't have them, maybe you can share the code for pretraining? It would be very helpful for me!

@.*** Thank you in advance!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

arthuremir commented 2 years ago

Ah, thanks!

arthuremir commented 2 years ago

Hi!

Did you test small and base models? Seems like it fails with a shape mismatch at any input sizes. Code snippet:


model = ALTGVT.alt_gvt_base(pretrained=False)

model.eval()

for img_size in range(50, 1500):
    inputs = torch.randn((1, 3, img_size, img_size))
    try:
        model(inputs)
        print('works fine', img_size)
    except:
        print('failed on', img_size)
wfs123456 commented 2 years ago

Ah, I misunderstood what you meant. The previous link is the pertrained parameters of the backbone(ALTGVT of the paper Twins) of the CCTrans.  If need the base or tiny model of CCTrans, u can retrain.  But, 

as far as I know, the results are not good.

---Original--- From: @.> Date: Fri, May 6, 2022 20:25 PM To: @.>; Cc: @.**@.>; Subject: Re: [wfs123456/CCTrans] Pretrained weights for small and base (Issue#11)

Hi!

Did you test small and base models? Seems like it fails with a shape mismatch at any input sizes. Code snippet: model = ALTGVT.alt_gvt_base(pretrained=False) model.eval() for img_size in range(50, 1500): inputs = torch.randn((1, 3, img_size, img_size)) try: model(inputs) print('works fine', img_size) except: print('failed on', img_size)
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

arthuremir commented 2 years ago

Sorry, my first question is not directly related to second. (May be I should create another issue)

I'm trying to run small and base models from CCTrans (even without preloaded weights) and getting a shape mismatch. Large models successfully processes input sizes 256, 512, and 768, but small and base models fail on all of them. So may be there are some architecture issues?

wfs123456 commented 2 years ago

This phenomenon is caused by different patch_size with 7. (detailed in Function Altgvt_small). 7 is not divided by 256, so change crop_size to 224.

---Original--- From: @.> Date: Fri, May 6, 2022 21:02 PM To: @.>; Cc: @.**@.>; Subject: Re: [wfs123456/CCTrans] Pretrained weights for small and base (Issue#11)

Sorry, my first question is not directly related to second. (May be I should create another issue)

I'm trying to run small and base models from CCTrans (even without preloaded weights) and getting a shape mismatch. Large models successfully processes input sizes 256, 512, and 768, but small and base models fails on all of them. So may be there are some architecture issues?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

arthuremir commented 2 years ago

Do you mean that the small and base models should work correctly on the input with shape (1, 3, 224, 224)?

arthuremir commented 2 years ago

I'm asking because small and base models give shape mismatch on (1, 3, 224, 224).