From 4a62a96618b8264cd8e79ab5f630e2d11565cb33 Mon Sep 17 00:00:00 2001 From: Charles Dickens Date: Fri, 15 Mar 2024 14:40:56 -0700 Subject: [PATCH] Cast data as np array in test tf model. --- .../tests/resources/models/deeppsl/sign/tensorflow_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/psl-python/tests/resources/models/deeppsl/sign/tensorflow_model.py b/psl-python/tests/resources/models/deeppsl/sign/tensorflow_model.py index eadacd1e2..abe61f4ab 100755 --- a/psl-python/tests/resources/models/deeppsl/sign/tensorflow_model.py +++ b/psl-python/tests/resources/models/deeppsl/sign/tensorflow_model.py @@ -56,7 +56,7 @@ def internal_fit(self, data, gradients, options = {}): def internal_predict(self, data, options = {}): data = self._prepare_data(data) - predictions = self._model.predict(data[0], verbose=0) + predictions = self._model.predict(numpy.array(data[0]), verbose=0) return predictions, {} def internal_eval(self, data, options = {}): @@ -82,7 +82,7 @@ def _prepare_data(self, data): if len(data) == 2: return data - return [numpy.asarray(data[:,:-1]), numpy.asarray([[1, 0] if label == 0 else [0, 1] for label in data[:,-1]])] + return [numpy.asarray(data[:, :-1]), numpy.asarray([[1, 0] if label == 0 else [0, 1] for label in data[:,-1]])] def calculate_metrics(y_pred, y_truth, metrics):