From eb1680da93d9d522cdfe3d8afd046f939f8d3752 Mon Sep 17 00:00:00 2001 From: "Joshua J. Cogliati" Date: Wed, 11 Dec 2024 14:51:46 -0700 Subject: [PATCH] Fix working with newer tensorflow. --- ravenframework/SupervisedLearning/KerasBase.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ravenframework/SupervisedLearning/KerasBase.py b/ravenframework/SupervisedLearning/KerasBase.py index 5b03970e60..95b789649d 100644 --- a/ravenframework/SupervisedLearning/KerasBase.py +++ b/ravenframework/SupervisedLearning/KerasBase.py @@ -2348,7 +2348,10 @@ def __returnInitialParametersLocal__(self): @ In, None @ Out, params, dict, dictionary of parameter names and initial values """ - params = copy.deepcopy(self.__dict__) + selfDict = copy.copy(self.__dict__) + # labelEncoder can't be deepcopied so remove if it exists + selfDict.pop("labelEncoder", None) + params = copy.deepcopy(selfDict) return params def __returnCurrentSettingLocal__(self):