Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Points cannot contain NaN #7

Open
kobezy opened this issue Nov 13, 2023 · 2 comments
Open

ValueError: Points cannot contain NaN #7

kobezy opened this issue Nov 13, 2023 · 2 comments

Comments

@kobezy
Copy link

kobezy commented Nov 13, 2023

您好,请问在运行大些的数据集(如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
Copy link
Owner

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
Copy link

我也遇到了类似的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants