Skip to content

请问一下模型权重加载不成功是指定backbone,decoder错误吗? #39

@XIEFOX

Description

@XIEFOX

在encoder_decoder文件夹下执行test_gpu.py
准备好了处理好的potsdam数据集。
运行CUDA_VISIBLE_DEVICES=0 python "test_gpu.py" --backbone 'resnet50' --decoder 'upernet' --dataset 'potsdam' --ms 'False' --mode 'test' --resume "/media/sdb/xxxx/potsdam/resnet50_upernet_imp_sep_model.pth" --save_path "xxxxxx"
报错模型权重不匹配?
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for SemsegFinetuneFramework:
Missing key(s) in state_dict: "semseghead.1.weight", "semseghead.1.bias".
Unexpected key(s) in state_dict: "semseghead_1.1.weight", "semseghead_1.1.bias", "semseghead_2.1.weight", "semseghead_2.1.bias", "semseghead_3.1.weight", "semseghead_3.1.bias".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions