From 4660f80141d1952216fb8434893180abc91de151 Mon Sep 17 00:00:00 2001 From: MeowZheng Date: Sat, 9 Apr 2022 22:05:48 +0800 Subject: [PATCH] [Fix] inconsistent dtype ofseg_label in stdc decode --- mmseg/models/decode_heads/stdc_head.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmseg/models/decode_heads/stdc_head.py b/mmseg/models/decode_heads/stdc_head.py index 1e678ace14..1cf3732ceb 100644 --- a/mmseg/models/decode_heads/stdc_head.py +++ b/mmseg/models/decode_heads/stdc_head.py @@ -37,7 +37,7 @@ def losses(self, seg_logit, seg_label): # parameters. However, it is a constant in original repo and other # codebase because it would not be added into computation graph # after threshold operation. - seg_label = seg_label.float() + seg_label = seg_label.to(self.laplacian_kernel) boundary_targets = F.conv2d( seg_label, self.laplacian_kernel, padding=1) boundary_targets = boundary_targets.clamp(min=0)