From 5a33561abba425ffb771737b0ee8b4c3cdfb00bf Mon Sep 17 00:00:00 2001 From: Michel Breyer Date: Tue, 10 Aug 2021 17:17:37 +0200 Subject: [PATCH] Fix issue with nans --- active_grasp/policy.py | 1 + 1 file changed, 1 insertion(+) diff --git a/active_grasp/policy.py b/active_grasp/policy.py index 90810c6..ab4d66b 100644 --- a/active_grasp/policy.py +++ b/active_grasp/policy.py @@ -85,6 +85,7 @@ class BasePolicy(Policy): # The next line prints a warning since some voxels have no grasp # predictions resulting in empty slices. qual = np.mean(self.qual_hist[:T, ...], axis=0, where=mask) + qual = np.nan_to_num(qual, copy=False) qual = threshold_quality(qual, 0.9) index_list = select_local_maxima(qual, 3)