Skip to content

测试问题 #38

@Whitefoxface

Description

@Whitefoxface

当我训练完Semi-Mamba-UNet想要测试的时候,遇到了些问题:
1、python test_2D_fully.py --root_path ../data/ACDC --exp ACDC/Semi_Mamba_UNet --model mambaunet --num_classes 4 --labeled_num 3
=> merge config from ../code/configs/swin_tiny_patch4_window7_224_lite.yaml
../model/ACDC/Semi_Mamba_UNet_3/mambaunet/mambaunet_best_model.pth
Traceback (most recent call last):
File "test_2D_fully.py", line 124, in
metric = Inference(FLAGS)
File "test_2D_fully.py", line 104, in Inference
net.load_state_dict(torch.load(save_mode_path))
AttributeError: 'NoneType' object has no attribute 'load_state_dict'
于是我做出了如下改动:
在net_factory中添加:from networks.vision_mamba import MambaUnet as ViM_seg
elif net_type == "mambaunet" or net_type == "vimmamba":
net = ViM_seg(config,img_size=args.patch_size,num_classes=class_num).cuda()
然后就遇到了第二个问题:
2、python test_2D_fully.py --root_path ../data/ACDC --exp ACDC/Semi_Mamba_UNet --model mambaunet --num_classes 4 --labeled_num 3
=> merge config from ../code/configs/swin_tiny_patch4_window7_224_lite.yaml
Traceback (most recent call last):
File "test_2D_fully.py", line 124, in
metric = Inference(FLAGS)
File "test_2D_fully.py", line 99, in Inference
net = net_factory(net_type=FLAGS.model, in_chns=1,
File "/home/pdl/wb/Mamba-UNet-main/code/networks/net_factory.py", line 94, in net_factory
net = ViM_seg(config,img_size=args.patch_size,num_classes=class_num).cuda()
File "/home/pdl/wb/Mamba-UNet-main/code/networks/vision_mamba.py", line 31, in init
patch_size=config.MODEL.VSSM.PATCH_SIZE,
File "/home/pdl/anaconda3/envs/vmunet/lib/python3.8/site-packages/yacs/config.py", line 141, in getattr
raise AttributeError(name)
AttributeError: VSSM
请求大佬的帮助

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions