From 71c6ff18c46ec0f5fee7202e46e8ca81c2e6df0c Mon Sep 17 00:00:00 2001 From: robcaulk Date: Wed, 7 Dec 2022 20:08:31 +0100 Subject: [PATCH] try to avoid possible memory leaks --- docs/freqai-configuration.md | 4 ++-- freqtrade/freqai/prediction_models/CNNPredictionModel.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/freqai-configuration.md b/docs/freqai-configuration.md index 3366ac592..c49efa753 100644 --- a/docs/freqai-configuration.md +++ b/docs/freqai-configuration.md @@ -252,9 +252,9 @@ The `CNNPredictionModel` is a non-linear regression based on `Tensorflow` which "batch_size": 64, "epochs": 10, "verbose": "auto", - "shuffle": false + "shuffle": false, "workers": 1, - "use_multiprocessing": False + "use_multiprocessing": false } ``` diff --git a/freqtrade/freqai/prediction_models/CNNPredictionModel.py b/freqtrade/freqai/prediction_models/CNNPredictionModel.py index 35d0b75fb..bf9ad22d5 100644 --- a/freqtrade/freqai/prediction_models/CNNPredictionModel.py +++ b/freqtrade/freqai/prediction_models/CNNPredictionModel.py @@ -133,6 +133,7 @@ class CNNPredictionModel(BaseTensorFlowModel): else: data = dk.data_dictionary["prediction_features"] data = tf.expand_dims(data, axis=0) + data = tf.convert_to_tensor(data) predictions = self.model(data, training=False) predictions = predictions[:, 0, 0]