From 814b2ee6a8d2cf8c3b436c02c15176ca227233dc Mon Sep 17 00:00:00 2001 From: Larry Yan Date: Mon, 9 Sep 2019 13:52:21 +0800 Subject: [PATCH] fix(encoder): fix vald encocer --- gnes/encoder/numeric/vlad.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnes/encoder/numeric/vlad.py b/gnes/encoder/numeric/vlad.py index d8d1cb0b..433a0c97 100644 --- a/gnes/encoder/numeric/vlad.py +++ b/gnes/encoder/numeric/vlad.py @@ -47,8 +47,8 @@ def faiss_index(self): def kmeans_pred(self, vecs): if self.using_faiss_pred: - D, I = self.index_flat.search(vecs.astype(np.float32), 1) - return np.reshape(I, [-1]) + _, pred = self.index_flat.search(vecs.astype(np.float32), 1) + return np.reshape(pred, [-1]) else: vecs = np.reshape(vecs, [vecs.shape[0], 1, 1, vecs.shape[1]]) dist = np.sum(np.square(vecs - self.centroids), -1)