yhygao / CBIM-Medical-Image-Segmentation

A PyTorch framework for medical image segmentation
Apache License 2.0
260 stars 46 forks source link

Some problems in running the code. #9

Closed jingkunchen closed 1 year ago

jingkunchen commented 2 years ago

Hi Yunhe,

I run your code with acdc 3D dataset. The data conversion is OK, but there is something wrong with the training.

python3 train.py --model utnetv2 --dimension 3d --dataset acdc --batch_size 3 --unique_name acdc_3dutnetv2 --gpu 0 Loading configurations from config/acdc/utnetv2_3d.yaml Traceback (most recent call last): File "train.py", line 212, in net, ema_net = init_network(args) File "train.py", line 186, in init_network net = get_model(args, pretrain=args.pretrain) File "CBIM-Medical-Image-Segmentation/model/utils.py", line 95, in get_model return UTNetV2(args.in_chan, args.classes, args.base_chan, map_size=args.map_size, conv_block=args.conv_block, conv_num=args.conv_num, trans_num=args.trans_num, chan_num=args.chan_num, num_heads=args.num_heads, fusion_depth=args.fusion_depth, fusion_dim=args.fusion_dim, fusion_heads=args.fusion_heads, expansion=args.expansion, attn_drop=args.attn_drop, proj_drop=args.proj_drop, proj_type=args.proj_type, norm=args.norm, act=args.act, kernel_size=args.kernel_size, scale=args.down_scale) AttributeError: 'Namespace' object has no attribute 'chan_num'

yhygao commented 1 year ago

Hi,

This is a typo. Just remove this argument, then the code runs correctly. I've already corrected this problem in the new commit.