yangxue0827 / RotationDetection

This is a tensorflow-based rotation detection benchmark, also called AlphaRotate.
https://rotationdetection.readthedocs.io/
Apache License 2.0
1.08k stars 181 forks source link

hello 你好 使用kld loss嵌入到自己的mmdetection中出现了维度问题 想了解一下 #88

Closed wxggzz closed 2 years ago

wxggzz commented 2 years ago
e 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/workspace/OBBDetection/mmdet/models/losses/gaussian_distance_loss.py", line 237, in forward
    **_kwargs) * self.loss_weight
  File "/workspace/OBBDetection/mmdet/models/losses/utils.py", line 103, in wrapper
    loss = weight_reduce_loss(loss, weight, reduction, avg_factor)
  File "/workspace/OBBDetection/mmdet/models/losses/utils.py", line 41, in weight_reduce_loss
    loss = loss * weight
RuntimeError: The size of tensor a (100) must match the size of tensor b (5) at non-singleton dimension 1

不过这是pytorch版本的,是否和你的版本相似的 调试了一是计算loss的时候,gwd计算出的loss是一维的 ,但是weight是二维的 什么情况下loss计算出是一维或者二维的呢。不好意思打扰了

yangxue0827 commented 2 years ago

mmrotate已经开源,可以参考里面gwd的实现 https://github.com/open-mmlab/mmrotate