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

Out of index value when getting probability map #11

Open
eddienewton opened this issue Nov 21, 2019 · 3 comments
Open

Out of index value when getting probability map #11

eddienewton opened this issue Nov 21, 2019 · 3 comments

Comments

@eddienewton
Copy link

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!

@eddienewton
Copy link
Author

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?

@callmeray
Copy link
Owner

I've not seen this problem before. Apply clip to d_coordiantes may be a good solution.

@eddienewton
Copy link
Author

@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!

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

2 participants