You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
当使用单个损失如 CrossEntropyLoss或者diceloss时不会报错。但如果同时使用,则会报错:Traceback (most recent call last):
File "train.py", line 242, in
main()
File "train.py", line 238, in main
meta=meta)
File "/home/deeplearning/MetaSeg-main/mmseg/apis/train.py", line 194, in train_segmentor
runner.run(data_loaders, cfg.workflow)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/mmcv/runner/iter_based_runner.py", line 144, in run
iter_runner(iter_loaders[i], **kwargs)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/mmcv/runner/iter_based_runner.py", line 64, in train
outputs = self.model.train_step(data_batch, self.optimizer, **kwargs)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/mmcv/parallel/data_parallel.py", line 77, in train_step
return self.module.train_step(*inputs[0], **kwargs[0])
File "/home/deeplearning/MetaSeg-main/mmseg/models/segmentors/base.py", line 138, in train_step
losses = self(**data_batch)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 116, in new_func
return old_func(*args, **kwargs)
File "/home/deeplearning/MetaSeg-main/mmseg/models/segmentors/base.py", line 108, in forward
return self.forward_train(img, img_metas, **kwargs)
File "/home/deeplearning/MetaSeg-main/mmseg/models/segmentors/encoder_decoder.py", line 144, in forward_train
gt_semantic_seg)
File "/home/deeplearning/MetaSeg-main/mmseg/models/segmentors/encoder_decoder.py", line 88, in _decode_head_forward_train
self.train_cfg)
File "/home/deeplearning/MetaSeg-main/mmseg/models/decode_heads/decode_head.py", line 192, in forward_train
losses = self.losses(seg_logits, gt_semantic_seg)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 205, in new_func
return old_func(*args, **kwargs)
File "/home/deeplearning/MetaSeg-main/mmseg/models/decode_heads/decode_head.py", line 237, in losses
ignore_index=self.ignore_index)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
TypeError: forward() got an unexpected keyword argument 'weight'
The text was updated successfully, but these errors were encountered:
当使用单个损失如 CrossEntropyLoss或者diceloss时不会报错。但如果同时使用,则会报错:Traceback (most recent call last):
File "train.py", line 242, in
main()
File "train.py", line 238, in main
meta=meta)
File "/home/deeplearning/MetaSeg-main/mmseg/apis/train.py", line 194, in train_segmentor
runner.run(data_loaders, cfg.workflow)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/mmcv/runner/iter_based_runner.py", line 144, in run
iter_runner(iter_loaders[i], **kwargs)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/mmcv/runner/iter_based_runner.py", line 64, in train
outputs = self.model.train_step(data_batch, self.optimizer, **kwargs)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/mmcv/parallel/data_parallel.py", line 77, in train_step
return self.module.train_step(*inputs[0], **kwargs[0])
File "/home/deeplearning/MetaSeg-main/mmseg/models/segmentors/base.py", line 138, in train_step
losses = self(**data_batch)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 116, in new_func
return old_func(*args, **kwargs)
File "/home/deeplearning/MetaSeg-main/mmseg/models/segmentors/base.py", line 108, in forward
return self.forward_train(img, img_metas, **kwargs)
File "/home/deeplearning/MetaSeg-main/mmseg/models/segmentors/encoder_decoder.py", line 144, in forward_train
gt_semantic_seg)
File "/home/deeplearning/MetaSeg-main/mmseg/models/segmentors/encoder_decoder.py", line 88, in _decode_head_forward_train
self.train_cfg)
File "/home/deeplearning/MetaSeg-main/mmseg/models/decode_heads/decode_head.py", line 192, in forward_train
losses = self.losses(seg_logits, gt_semantic_seg)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 205, in new_func
return old_func(*args, **kwargs)
File "/home/deeplearning/MetaSeg-main/mmseg/models/decode_heads/decode_head.py", line 237, in losses
ignore_index=self.ignore_index)
File "/home/deeplearning/anaconda3/envs/lyc/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
TypeError: forward() got an unexpected keyword argument 'weight'
The text was updated successfully, but these errors were encountered: