Closed SaulZhang closed 1 year ago
I also meet the problem, do you solve it?
I solve this problem by add dict(type='ToMask'),
into the train_pipeline
in config files.
I solve this problem by add
dict(type='ToMask'),
into thetrain_pipeline
in config files.
hello! I also meet the problem after adding dict(type='ToMask')
into the train_pipeline
,can you share your configs?
Is mask2former only applicable to instance segmentation and panoptic segmentation? I use the base config mask2former_beit_cocostuff
Hi, @czczup I train the segmentation task on the custom dataset, and the GT is only the
gt_semantic_seg
but not 'gt_labels
' and 'gt_masks
' which seems the target for instance segmentation task, and how to solve this problem?Traceback (most recent call last): File "./train.py", line 219, in
main()
File "./train.py", line 208, in main
train_segmentor(
File "/mnt/yrfs/OurProjects/ViT-Adapter/segmentation/mmseg_custom/apis/train.py", line 215, in train_segmentor
runner.run(data_loaders, cfg.workflow)
File "/mnt/yrfs/anaconda3/envs/vit/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 134, in run
iter_runner(iter_loaders[i], kwargs)
File "/mnt/yrfs/anaconda3/envs/vit/lib/python3.8/site-packages/mmcv/runner/iter_based_runner.py", line 61, in train
outputs = self.model.train_step(data_batch, self.optimizer, kwargs)
File "/mnt/yrfs/anaconda3/envs/vit/lib/python3.8/site-packages/mmcv/parallel/distributed.py", line 52, in train_step
output = self.module.train_step(inputs[0], kwargs[0])
File "/mnt/yrfs/anaconda3/envs/vit/lib/python3.8/site-packages/mmseg/models/segmentors/base.py", line 138, in train_step
losses = self(data_batch)
File "/mnt/yrfs/anaconda3/envs/vit/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(input, *kwargs)
File "/mnt/yrfs/anaconda3/envs/vit/lib/python3.8/site-packages/mmcv/runner/fp16_utils.py", line 98, in new_func
return old_func(args, kwargs)
File "/mnt/yrfs/anaconda3/envs/vit/lib/python3.8/site-packages/mmseg/models/segmentors/base.py", line 108, in forward
return self.forward_train(img, img_metas, kwargs)
File "/mnt/yrfs/OurProjects/ViT-Adapter/segmentation/mmseg_custom/models/segmentors/encoder_decoder_mask2former.py", line 147, in forward_train
loss_decode = self._decode_head_forward_train(x, img_metas,
File "/mnt/yrfs/OurProjects/ViT-Adapter/segmentation/mmseg_custom/models/segmentors/encoder_decoder_mask2former.py", line 91, in _decode_head_forward_train
loss_decode = self.decode_head.forward_train(x, img_metas,
TypeError: forward_train() missing 2 required positional arguments: 'gt_labels' and 'gt_masks'