PointMVSNet
PointMVSNet copied to clipboard
Out of index value when getting probability map
During some of my tests, I found that pointMVS fails with an out of index in function get_propability_map
.
Specifically, the issue is that d_coordinates_right0
and d_coordinates_left0
are filled with negative indices.
From what I can tell, the issue arrises in this line:
filtered_cost_volume = self.coarse_vol_conv(cost_volume).squeeze(1)
Basically filtered_cost_volume
is nan
, causing everything else to fail.
It'll probably be best to put a torch.isnan()
check after filtered_cost_volume
?
Thanks!
I was able to get it working by doing the following:
isNanMask = torch.isnan(filtered_cost_volume)
filtered_cost_volume[isNanMask] = 0.0
From what I've seen, if a value is NaN, the entire matrix is NaN, but the above will work in the case one value is NaN and the rest are valid.
The other solution is to return the forward() in the case any NaN value is detected.
Thoughts?
I've not seen this problem before. Apply clip to d_coordiantes
may be a good solution.
@callmeray that's a good idea.
FYI, I tested PointMVS with my datasets again. I also had to add the following to the eval_file_logger file:
#ensure prob does not have nan values
isNanMask = np.isnan(out_flow_prob_map)
out_flow_prob_map[isNanMask] = 0.0
After these two changes, I've been able to run without issue. The fact that my datasets aren't ideal might be the reason for the occasional nan.
Thanks again for the good work!