SysCV / sam-hq

Segment Anything in High Quality [NeurIPS 2023]
https://arxiv.org/abs/2306.01567
Apache License 2.0
3.73k stars 224 forks source link

Runtime error in Colab #129

Open gttae opened 7 months ago

gttae commented 7 months ago

Thank you for conducting such excellent research. I have modified the train code to run it on Colab and executed it. However, I am leaving this message to seek advice because I encountered this error.

in build_sam_vit_b(checkpoint) 32 33 def build_sam_vit_b(checkpoint=None): ---> 34 return _build_sam( 35 encoder_embed_dim=768, 36 encoder_depth=12, in _build_sam(encoder_embed_dim, encoder_depth, encoder_num_heads, encoder_global_attn_indexes, checkpoint) 61 image_embedding_size = image_size // vit_patch_size 62 sam = Sam( ---> 63 image_encoder=ImageEncoderViT( 64 depth=encoder_depth, 65 embed_dim=encoder_embed_dim, in __init__(self, img_size, patch_size, in_chans, embed_dim, depth, num_heads, mlp_ratio, out_chans, qkv_bias, norm_layer, act_layer, use_abs_pos, use_rel_pos, rel_pos_zero_init, window_size, global_attn_indexes) 72 73 for i in range(depth): ---> 74 block = Block( 75 dim=embed_dim, 76 num_heads=num_heads, in __init__(self, dim, num_heads, mlp_ratio, qkv_bias, norm_layer, act_layer, use_rel_pos, rel_pos_zero_init, window_size, input_size) 153 super().__init__() 154 self.norm1 = norm_layer(dim) --> 155 self.attn = Attention( 156 dim, 157 num_heads=num_heads, **TypeError: Attention.__init__() got an unexpected keyword argument 'qkv_bias'**
gttae commented 7 months ago

Can I receive the file 'pretrained_checkpoint/sam_vit_b_maskdecoder.pth'?