flyingshan / Learning-Polar-Encodings-For-Arbitrary-Oriented-Ship-Detection-In-SAR-Images

Code for paper "Learning-Polar-Encodings-For-Arbitrary-Oriented-Ship-Detection-In-SAR-Images"
MIT License
24 stars 7 forks source link

ValueError: Points cannot contain NaN #7

Open kobezy opened 1 year ago

kobezy commented 1 year ago

您好,请问在运行大些的数据集(如HRSID,RSDD-SAR)时为什么总会出现这个问题:仿佛是模型不太稳定。 Traceback (most recent call last): File "/home/Learning-Polar-Encodings-For-Arbitrary-Oriented-Ship-Detection-In-SAR-Images-master/train.py", line 199, in run_epoch loss = criterion(pr_decs, data_dict) File "/root/miniconda3/envs/gagale/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, *kwargs) File "/home/Learning-Polar-Encodings-For-Arbitrary-Oriented-Ship-Detection-In-SAR-Images-master/loss.py", line 126, in forward wh_loss, iou_loss = self.L_wh(pr_decs['wh'], gt_batch['reg_mask'], gt_batch['ind'], gt_batch['wh'])#wh_loss 和 iou_loss 分别代表宽度(width)和高度(height)的损失,由 IoUWeightedSmoothL1Loss 计算得出。 File "/root/miniconda3/envs/gagale/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(input, **kwargs) File "/home/Learning-Polar-Encodings-For-Arbitrary-Oriented-Ship-Detection-In-SAR-Images-master/polar.py", line 453, in forward ious_all_lists = self._calculate_ious(output, mask, ind, target) File "/home/Learning-Polar-Encodings-For-Arbitrary-Oriented-Ship-Detection-In-SAR-Images-master/polar.py", line 429, in _calculate_ious pred_bboxes = self._polar_to_bboxes(valid_pred) # [num_obj, 8] File "/home/Learning-Polar-Encodings-For-Arbitrary-Oriented-Ship-Detection-In-SAR-Images-master/polar.py", line 354, in _polar_to_bboxes mbb = MinimumBoundingBox(target_pts) File "/home/Learning-Polar-Encodings-For-Arbitrary-Oriented-Ship-Detection-In-SAR-Images-master/MBB.py", line 109, in MinimumBoundingBox hull_ordered = [points[index] for index in ConvexHull(points).vertices] File "qhull.pyx", line 2431, in scipy.spatial.qhull.ConvexHull.init File "qhull.pyx", line 283, in scipy.spatial.qhull._Qhull.init ValueError: Points cannot contain NaN

flyingshan commented 1 year ago

File "/home/Learning-Polar-Encodings-For-Arbitrary-Oriented-Ship-Detection-In-SAR-Images-master/polar.py", line 429, in _calculate_ious pred_bboxes = self._polar_to_bboxes(valid_pred) # [num_obj, 8]

看起来是极坐标点转直角坐标点之后出现了null值的点,您可以debug看一下这里valid_pred里面是不是有一些有问题的输出

Untilseeuu commented 9 months ago

我也遇到了类似的问题