open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.02k stars 9.36k forks source link

get err when training VarifocalNet using fp16 #4172

Closed carry-xz closed 3 years ago

carry-xz commented 3 years ago

hi,when i training vfnet using ‘fp16 = dict(loss_scale=512.)’ , I get some err: ''' File "/workspace/code/mmdet/mmdetection_xz/mmdetection/mmdet/models/dense_heads/vfnet_head.py", line 261, in forward_single reg_feat = self.relu(self.vfnet_reg_refine_dconv(reg_feat, dcn_offset)) File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/root/miniconda3/lib/python3.8/site-packages/mmcv/ops/deform_conv.py", line 234, in forward out = deform_conv2d(x, offset, self.weight, self.stride, self.padding, File "/root/miniconda3/lib/python3.8/site-packages/mmcv/ops/deform_conv.py", line 73, in forward ext_module.deform_conv_forward( RuntimeError: expected scalar type Half but found Float '''

v-qjqs commented 3 years ago

Hi @carry-xz, thanks for your PR and we will check it.

Mixelon-tera commented 3 years ago

Yeah, I found this problem too.