From 27ff571af4e9f83962663ff82f8fda1ba631b087 Mon Sep 17 00:00:00 2001 From: Tiago Freitas Pereira <tiagofrepereira@gmail.com> Date: Thu, 12 Sep 2019 08:56:45 +0200 Subject: [PATCH] Fixed issue with numpy.ndarray.resize py37 --- bob/bio/base/algorithm/LDA.py | 2 +- bob/bio/base/algorithm/PCA.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bob/bio/base/algorithm/LDA.py b/bob/bio/base/algorithm/LDA.py index 5bcc21e6..26b507e2 100644 --- a/bob/bio/base/algorithm/LDA.py +++ b/bob/bio/base/algorithm/LDA.py @@ -180,7 +180,7 @@ class LDA (Algorithm): if self.lda_subspace is not None: self.machine.resize(self.machine.shape[0], self.lda_subspace) self.variances = self.variances.copy() - self.variances.resize(self.lda_subspace) + self.variances = numpy.resize(self.variances, (self.lda_subspace)) if self.pca_subspace is not None: # compute combined PCA/LDA projection matrix diff --git a/bob/bio/base/algorithm/PCA.py b/bob/bio/base/algorithm/PCA.py index d62faf5c..a856292d 100644 --- a/bob/bio/base/algorithm/PCA.py +++ b/bob/bio/base/algorithm/PCA.py @@ -109,7 +109,7 @@ class PCA (Algorithm): logger.info(" ... Keeping %d PCA dimensions", self.subspace_dim) # re-shape machine self.machine.resize(self.machine.shape[0], self.subspace_dim) - self.variances.resize(self.subspace_dim) + self.variances = numpy.resize(self.variances, (self.subspace_dim)) f = bob.io.base.HDF5File(projector_file, "w") f.set("Eigenvalues", self.variances) -- GitLab