Trans2Seg icon indicating copy to clipboard operation
Trans2Seg copied to clipboard

about demo

Open WTsPython opened this issue 2 years ago • 5 comments

Does anyone knows how to use the demo?It always has a AssertionError when i use it. File "E:\python\Trans2Seg-master\segmentron\models\trans2seg.py", line 74, in forward cls_token, x = self.vit.forward_encoder(x) File "E:\python\Trans2Seg-master\segmentron\modules\transformer.py", line 224, in forward_encoder pos_embed = self.resize_pos_embed(x, pos_embed) File "E:\python\Trans2Seg-master\segmentron\modules\transformer.py", line 242, in resize_pos_embed assert x_h * x_w == hw-1 AssertionError

WTsPython avatar Mar 11 '22 04:03 WTsPython

I have the same problem too

3Dimax avatar Mar 12 '22 08:03 3Dimax

I have the same problem too

Have you solved it?

WTsPython avatar Mar 14 '22 00:03 WTsPython

Not yet . If you soved it please tell me

3Dimax avatar Mar 14 '22 02:03 3Dimax

@3Dimax @WTsPython , try this fix: https://github.com/leochan2009/Trans2Seg/blob/GLDataset/segmentron/modules/transformer.py#L134

leochan2009 avatar May 16 '22 13:05 leochan2009

@3Dimax @WTsPython , try this fix: https://github.com/leochan2009/Trans2Seg/blob/GLDataset/segmentron/modules/transformer.py#L134

It seems that this fix cannot solve this problem. I still get an assertion error when trying to use the demo.py, lol

LiJiarui111 avatar Dec 27 '22 05:12 LiJiarui111