ZhengPeng7 / BiRefNet

[CAAI AIR'24] Bilateral Reference for High-Resolution Dichotomous Image Segmentation
https://www.birefnet.top
MIT License
322 stars 28 forks source link

RuntimeError: Error(s) in loading state_dict #25

Closed tanujjjj closed 2 months ago

tanujjjj commented 2 months ago

Unexpected key(s) in state_dict: "squeeze_module.0.dec_att.aspp1.bn.weight", "squeeze_module.0.dec_att.aspp1.bn.bias", "squeeze_module.0.dec_att.aspp1.bn.running_mean", "squeeze_module.0.dec_att.aspp1.bn.running_var", "squeeze_module.0.dec_att.aspp1.bn.num_batches_tracked", "squeeze_module.0.dec_att.aspp_deforms.0.bn.weight", "squeeze_module.0.dec_att.aspp_deforms.0.bn.bias", "squeeze_module.0.dec_att.aspp_deforms.0.bn.running_mean", "squeeze_module.0.dec_att.aspp_deforms.0.bn.running_var", "squeeze_module.0.dec_att.aspp_deforms.0.bn.num_batches_tracked", "squeeze_module.0.dec_att.aspp_deforms.1.bn.weight", "squeeze_module.0.dec_att.aspp_deforms.1.bn.bias", "squeeze_module.0.dec_att.aspp_deforms.1.bn.running_mean", "squeeze_module.0.dec_att.aspp_deforms.1.bn.running_var", "squeeze_module.0.dec_att.aspp_deforms.1.bn.num_batches_tracked", "squeeze_module.0.dec_att.aspp_deforms.2.bn.weight", "squeeze_module.0.dec_att.aspp_deforms.2.bn.bias", "squeeze_module.0.dec_att.aspp_deforms.2.bn.running_mean", "squeeze_module.0.dec_att.aspp_deforms.2.bn.running_var", "squeeze_module.0.dec_att.aspp_deforms.2.bn.num_batches_tracked", "squeeze_module.0.dec_att.global_avg_pool.2.weight", "squeeze_module.0.dec_att.global_avg_pool.2.bias", "squeeze_module.0.dec_att.global_avg_pool.2.running_mean", "squeeze_module.0.dec_att.global_avg_pool.2.running_var", "squeeze_module.0.dec_att.global_avg_pool.2.num_batches_tracked", "squeeze_module.0.dec_att.bn1.weight", "squeeze_module.0.dec_att.bn1.bias", "squeeze_module.0.dec_att.bn1.running_mean", "squeeze_module.0.dec_att.bn1.running_var", "squeeze_module.0.dec_att.bn1.num_batches_tracked", "squeeze_module.0.bn_in.weight", "squeeze_module.0.bn_in.bias", "squeeze_module.0.bn_in.running_mean", "squeeze_module.0.bn_in.running_var", "squeeze_module.0.bn_in.num_batches_tracked", "squeeze_module.0.bn_out.weight", "squeeze_module.0.bn_out.bias", "squeeze_module.0.bn_out.running_mean", "squeeze_module.0.bn_out.running_var", "squeeze_module.0.bn_out.num_batches_tracked", "decoder.decoder_block4.dec_att.aspp1.bn.weight", "decoder.decoder_block4.dec_att.aspp1.bn.bias", "decoder.decoder_block4.dec_att.aspp1.bn.running_mean", "decoder.decoder_block4.dec_att.aspp1.bn.running_var", "decoder.decoder_block4.dec_att.aspp1.bn.num_batches_tracked", "decoder.decoder_block4.dec_att.aspp_deforms.0.bn.weight", "decoder.decoder_block4.dec_att.aspp_deforms.0.bn.bias", "decoder.decoder_block4.dec_att.aspp_deforms.0.bn.running_mean", "decoder.decoder_block4.dec_att.aspp_deforms.0.bn.running_var", "decoder.decoder_block4.dec_att.aspp_deforms.0.bn.num_batches_tracked", "decoder.decoder_block4.dec_att.aspp_deforms.1.bn.weight", "decoder.decoder_block4.dec_att.aspp_deforms.1.bn.bias", "decoder.decoder_block4.dec_att.aspp_deforms.1.bn.running_mean", "decoder.decoder_block4.dec_att.aspp_deforms.1.bn.running_var", "decoder.decoder_block4.dec_att.aspp_deforms.1.bn.num_batches_tracked", "decoder.decoder_block4.dec_att.aspp_deforms.2.bn.weight", "decoder.decoder_block4.dec_att.aspp_deforms.2.bn.bias", "decoder.decoder_block4.dec_att.aspp_deforms.2.bn.running_mean", "decoder.decoder_block4.dec_att.aspp_deforms.2.bn.running_var", "decoder.decoder_block4.dec_att.aspp_deforms.2.bn.num_batches_tracked", "decoder.decoder_block4.dec_att.global_avg_pool.2.weight", "decoder.decoder_block4.dec_att.global_avg_pool.2.bias", "decoder.decoder_block4.dec_att.global_avg_pool.2.running_mean", "decoder.decoder_block4.dec_att.global_avg_pool.2.running_var", "decoder.decoder_block4.dec_att.global_avg_pool.2.num_batches_tracked", "decoder.decoder_block4.dec_att.bn1.weight", "decoder.decoder_block4.dec_att.bn1.bias", "decoder.decoder_block4.dec_att.bn1.running_mean", "decoder.decoder_block4.dec_att.bn1.running_var", "decoder.decoder_block4.dec_att.bn1.num_batches_tracked", "decoder.decoder_block4.bn_in.weight", "decoder.decoder_block4.bn_in.bias", "decoder.decoder_block4.bn_in.running_mean", "decoder.decoder_block4.bn_in.running_var", "decoder.decoder_block4.bn_in.num_batches_tracked", "decoder.decoder_block4.bn_out.weight", "decoder.decoder_block4.bn_out.bias", "decoder.decoder_block4.bn_out.running_mean", "decoder.decoder_block4.bn_out.running_var", "decoder.decoder_block4.bn_out.num_batches_tracked", "decoder.decoder_block3.dec_att.aspp1.bn.weight", "decoder.decoder_block3.dec_att.aspp1.bn.bias", "decoder.decoder_block3.dec_att.aspp1.bn.running_mean", "decoder.decoder_block3.dec_att.aspp1.bn.running_var", "decoder.decoder_block3.dec_att.aspp1.bn.num_batches_tracked", "decoder.decoder_block3.dec_att.aspp_deforms.0.bn.weight", "decoder.decoder_block3.dec_att.aspp_deforms.0.bn.bias", "decoder.decoder_block3.dec_att.aspp_deforms.0.bn.running_mean", "decoder.decoder_block3.dec_att.aspp_deforms.0.bn.running_var", "decoder.decoder_block3.dec_att.aspp_deforms.0.bn.num_batches_tracked", "decoder.decoder_block3.dec_att.aspp_deforms.1.bn.weight", "decoder.decoder_block3.dec_att.aspp_deforms.1.bn.bias", "decoder.decoder_block3.dec_att.aspp_deforms.1.bn.running_mean", "decoder.decoder_block3.dec_att.aspp_deforms.1.bn.running_var", "decoder.decoder_block3.dec_att.aspp_deforms.1.bn.num_batches_tracked", "decoder.decoder_block3.dec_att.aspp_deforms.2.bn.weight", "decoder.decoder_block3.dec_att.aspp_deforms.2.bn.bias", "decoder.decoder_block3.dec_att.aspp_deforms.2.bn.running_mean", "decoder.decoder_block3.dec_att.aspp_deforms.2.bn.running_var", "decoder.decoder_block3.dec_att.aspp_deforms.2.bn.num_batches_tracked", "decoder.decoder_block3.dec_att.global_avg_pool.2.weight", "decoder.decoder_block3.dec_att.global_avg_pool.2.bias", "decoder.decoder_block3.dec_att.global_avg_pool.2.running_mean", "decoder.decoder_block3.dec_att.global_avg_pool.2.running_var", "decoder.decoder_block3.dec_att.global_avg_pool.2.num_batches_tracked", "decoder.decoder_block3.dec_att.bn1.weight", "decoder.decoder_block3.dec_att.bn1.bias", "decoder.decoder_block3.dec_att.bn1.running_mean", "decoder.decoder_block3.dec_att.bn1.running_var", "decoder.decoder_block3.dec_att.bn1.num_batches_tracked", "decoder.decoder_block3.bn_in.weight", "decoder.decoder_block3.bn_in.bias", "decoder.decoder_block3.bn_in.running_mean", "decoder.decoder_block3.bn_in.running_var", "decoder.decoder_block3.bn_in.num_batches_tracked", "decoder.decoder_block3.bn_out.weight", "decoder.decoder_block3.bn_out.bias", "decoder.decoder_block3.bn_out.running_mean", "decoder.decoder_block3.bn_out.running_var", "decoder.decoder_block3.bn_out.num_batches_tracked", "decoder.decoder_block2.dec_att.aspp1.bn.weight", "decoder.decoder_block2.dec_att.aspp1.bn.bias", "decoder.decoder_block2.dec_att.aspp1.bn.running_mean", "decoder.decoder_block2.dec_att.aspp1.bn.running_var", "decoder.decoder_block2.dec_att.aspp1.bn.num_batches_tracked", "decoder.decoder_block2.dec_att.aspp_deforms.0.bn.weight", "decoder.decoder_block2.dec_att.aspp_deforms.0.bn.bias", "decoder.decoder_block2.dec_att.aspp_deforms.0.bn.running_mean", "decoder.decoder_block2.dec_att.aspp_deforms.0.bn.running_var", "decoder.decoder_block2.dec_att.aspp_deforms.0.bn.num_batches_tracked", "decoder.decoder_block2.dec_att.aspp_deforms.1.bn.weight", "decoder.decoder_block2.dec_att.aspp_deforms.1.bn.bias", "decoder.decoder_block2.dec_att.aspp_deforms.1.bn.running_mean", "decoder.decoder_block2.dec_att.aspp_deforms.1.bn.running_var", "decoder.decoder_block2.dec_att.aspp_deforms.1.bn.num_batches_tracked", "decoder.decoder_block2.dec_att.aspp_deforms.2.bn.weight", "decoder.decoder_block2.dec_att.aspp_deforms.2.bn.bias", "decoder.decoder_block2.dec_att.aspp_deforms.2.bn.running_mean", "decoder.decoder_block2.dec_att.aspp_deforms.2.bn.running_var", "decoder.decoder_block2.dec_att.aspp_deforms.2.bn.num_batches_tracked", "decoder.decoder_block2.dec_att.global_avg_pool.2.weight", "decoder.decoder_block2.dec_att.global_avg_pool.2.bias", "decoder.decoder_block2.dec_att.global_avg_pool.2.running_mean", "decoder.decoder_block2.dec_att.global_avg_pool.2.running_var", "decoder.decoder_block2.dec_att.global_avg_pool.2.num_batches_tracked", "decoder.decoder_block2.dec_att.bn1.weight", "decoder.decoder_block2.dec_att.bn1.bias", "decoder.decoder_block2.dec_att.bn1.running_mean", "decoder.decoder_block2.dec_att.bn1.running_var", "decoder.decoder_block2.dec_att.bn1.num_batches_tracked", "decoder.decoder_block2.bn_in.weight", "decoder.decoder_block2.bn_in.bias", "decoder.decoder_block2.bn_in.running_mean", "decoder.decoder_block2.bn_in.running_var", "decoder.decoder_block2.bn_in.num_batches_tracked", "decoder.decoder_block2.bn_out.weight", "decoder.decoder_block2.bn_out.bias", "decoder.decoder_block2.bn_out.running_mean", "decoder.decoder_block2.bn_out.running_var", "decoder.decoder_block2.bn_out.num_batches_tracked", "decoder.decoder_block1.dec_att.aspp1.bn.weight", "decoder.decoder_block1.dec_att.aspp1.bn.bias", "decoder.decoder_block1.dec_att.aspp1.bn.running_mean", "de coder.decoder_block1.dec_att.aspp1.bn.running_var", "decoder.decoder_block1.dec_att.aspp1.bn.num_batches_tracked", "decoder.decoder_block1.dec_att.aspp_deforms.0.bn.weight", "decoder.decoder_block1.decatt.aspp deforms.0.bn.bias", "decoder.decoder_block1.dec_att.aspp_deforms.0.bn.running_mean", "decoder.decoder_block1.dec_att.aspp_deforms.0.bn.running_var", "decoder.decoder_block1.dec_att.aspp_deforms.0.bn.numbatches tracked", "decoder.decoder_block1.dec_att.aspp_deforms.1.bn.weight", "decoder.decoder_block1.dec_att.aspp_deforms.1.bn.bias", "decoder.decoder_block1.dec_att.aspp_deforms.1.bn.running_mean", "decoder.decoder_blo ck1.dec_att.aspp_deforms.1.bn.running_var", "decoder.decoder_block1.dec_att.aspp_deforms.1.bn.num_batches_tracked", "decoder.decoder_block1.dec_att.aspp_deforms.2.bn.weight", "decoder.decoder_block1.dec_att.aspp _deforms.2.bn.bias", "decoder.decoder_block1.dec_att.aspp_deforms.2.bn.running_mean", "decoder.decoder_block1.dec_att.aspp_deforms.2.bn.running_var", "decoder.decoder_block1.dec_att.aspp_deforms.2.bn.num_batches _tracked", "decoder.decoder_block1.dec_att.global_avg_pool.2.weight", "decoder.decoder_block1.dec_att.global_avg_pool.2.bias", "decoder.decoder_block1.dec_att.global_avg_pool.2.running_mean", "decoder.decoder_bl ock1.dec_att.global_avg_pool.2.running_var", "decoder.decoder_block1.dec_att.global_avg_pool.2.num_batches_tracked", "decoder.decoder_block1.dec_att.bn1.weight", "decoder.decoder_block1.dec_att.bn1.bias", "decod er.decoder_block1.dec_att.bn1.running_mean", "decoder.decoder_block1.dec_att.bn1.running_var", "decoder.decoder_block1.dec_att.bn1.num_batches_tracked", "decoder.decoder_block1.bn_in.weight", "decoder.decoder_bl ock1.bn_in.bias", "decoder.decoder_block1.bn_in.running_mean", "decoder.decoder_block1.bn_in.running_var", "decoder.decoder_block1.bn_in.num_batches_tracked", "decoder.decoder_block1.bn_out.weight", "decoder.dec oder_block1.bn_out.bias", "decoder.decoder_block1.bn_out.running_mean", "decoder.decoder_block1.bn_out.running_var", "decoder.decoder_block1.bn_out.num_batches_tracked", "decoder.gdt_convs_4.1.weight", "decoder. gdt_convs_4.1.bias", "decoder.gdt_convs_4.1.running_mean", "decoder.gdt_convs_4.1.running_var", "decoder.gdt_convs_4.1.num_batches_tracked", "decoder.gdt_convs_3.1.weight", "decoder.gdt_convs_3.1.bias", "decoder .gdt_convs_3.1.running_mean", "decoder.gdt_convs_3.1.running_var", "decoder.gdt_convs_3.1.num_batches_tracked", "decoder.gdt_convs_2.1.weight", "decoder.gdt_convs_2.1.bias", "decoder.gdt_convs_2.1.running_mean", "decoder.gdt_convs_2.1.running_var", "decoder.gdt_convs_2.1.num_batches_tracked".

ZhengPeng7 commented 2 months ago

Which weights and code version did you use? I fixed some inconsistencies of components in codes and those in the paper. If all the stuff are latest, it should be okay.

tanujjjj commented 2 months ago

chkpt: BiRefNet-massive-epoch_240.pth bb wight: swin_large_patch4_window12_384_22kto1k.pth The code is latest. Also, Name: torch Version: 2.0.1+cu118

ZhengPeng7 commented 2 months ago

Hey, are you sure? I had a try just now as below:

截屏2024-05-15 19 29 44

Tell me if you still have problem with codes in the screenshot for loading weights.

ZhengPeng7 commented 2 months ago

Feel free to reopen this issue again if you still have problems.