-
Notifications
You must be signed in to change notification settings - Fork 27
Description
s = torch.tensor(
[[self.args.xyz_s_lambda * s_xyz, self.args.rgb_s_lambda * s_rgb, self.args.fusion_s_lambda * s_fusion]])
s_map = torch.cat([self.args.xyz_smap_lambda * s_map_xyz, self.args.rgb_smap_lambda * s_map_rgb,
self.args.fusion_smap_lambda * s_map_fusion], dim=0).squeeze().reshape(3, -1).permute(1, 0)
print(f"正在检查 s: {s}")
print(f"s 中的 NaN 数量: {np.isnan(s).sum()}")
print(f"s 中 NaN 的位置索引: {np.argwhere(np.isnan(s))}")
# 如果 s 是列表的列表或类似结构,请相应地调整检查代码
s = torch.tensor(self.detect_fuser.score_samples(s))
这里的s值包含了NaN无效值,我定位了一下是在compute_single_s_s_map里面点云数据出现的NaN,我想问一下为啥只有我报这个错,报错信息:
Extracting test features for class cable_gland: 10%|██████████▉ | 11/108 [00:30<04:27, 2.76s/it]
Traceback (most recent call last):
File "main.py", line 124, in
run_3d_ads(args)
File "main.py", line 21, in run_3d_ads
image_rocaucs, pixel_rocaucs, au_pros = model.evaluate(cls)
File "/mnt/d/M3DM-main/M3DM-main/m3dm_runner.py", line 84, in evaluate
method.predict(sample, mask, label)
File "/mnt/d/M3DM-main/M3DM-main/feature_extractors/multiple_features.py", line 799, in predict
self.compute_s_s_map(xyz_patch, rgb_patch, fusion_patch, xyz_patch_full_resized[0].shape[-2:], mask, label,
File "/mnt/d/M3DM-main/M3DM-main/feature_extractors/multiple_features.py", line 933, in compute_s_s_map
s = torch.tensor(self.detect_fuser.score_samples(s))
File "/home/mjj/.local/lib/python3.8/site-packages/sklearn/linear_model/stochastic_gradient.py", line 2546, in score_samples
score_samples = self.decision_function(X) + self.offset
File "/home/mjj/.local/lib/python3.8/site-packages/sklearn/linear_model/_stochastic_gradient.py", line 2528, in decision_function
X = self._validate_data(X, accept_sparse="csr", reset=False)
File "/home/mjj/.local/lib/python3.8/site-packages/sklearn/base.py", line 605, in _validate_data
out = check_array(X, input_name="X", **check_params)
File "/home/mjj/.local/lib/python3.8/site-packages/sklearn/utils/validation.py", line 957, in check_array
_assert_all_finite(
File "/home/mjj/.local/lib/python3.8/site-packages/sklearn/utils/validation.py", line 122, in _assert_all_finite
_assert_all_finite_element_wise(
File "/home/mjj/.local/lib/python3.8/site-packages/sklearn/utils/validation.py", line 171, in _assert_all_finite_element_wise
raise ValueError(msg_err)
ValueError: Input X contains NaN.
SGDOneClassSVM does not accept missing values encoded as NaN natively. For supervised learning, you might want to consider s