How to fix error on keras network learner?

Hi,
I am using keras network learner node.
Originally I can use keras network learner.
But, suddenly an error occurs.

This is the error message.

KNIME Log is as following.

What’s the problem and how can I fix it?

Sincerely,

2021-01-28 22:07:28,136 : ERROR : KNIME-Worker-13-Keras Network Learner 0:23 : : DLKerasLearnerNodeModel : Keras Network Learner : 0:23 : An error occurred while communicating with Python (while reading in the Keras network).
2021-01-28 22:07:28,136 : ERROR : KNIME-Worker-13-Keras Network Learner 0:23 : : Node : Keras Network Learner : 0:23 : Execute failed: An error occured during training of the Keras deep learning network. See log for details.
java.lang.RuntimeException: An error occured during training of the Keras deep learning network. See log for details.
at org.knime.dl.keras.base.nodes.learner.DLKerasLearnerNodeModel.handleGeneralException(DLKerasLearnerNodeModel.java:744)
at org.knime.dl.keras.base.nodes.learner.DLKerasLearnerNodeModel.executeInternal(DLKerasLearnerNodeModel.java:719)
at org.knime.dl.keras.base.nodes.learner.DLKerasLearnerNodeModel.execute(DLKerasLearnerNodeModel.java:321)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:576)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1245)
at org.knime.core.node.Node.execute(Node.java:1025)
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:558)
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:334)
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:210)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
Caused by: java.io.IOException: An error occurred while communicating with Python (while reading in the Keras network).
at org.knime.dl.keras.core.DLKerasAbstractNetworkLoader.loadInternal(DLKerasAbstractNetworkLoader.java:183)
at org.knime.dl.keras.core.DLKerasAbstractNetworkLoader.load(DLKerasAbstractNetworkLoader.java:136)
at org.knime.dl.keras.core.DLKerasAbstractNetworkLoader.load(DLKerasAbstractNetworkLoader.java:1)
at org.knime.dl.python.core.training.DLPythonAbstractNetworkTrainingSession.trainInternal(DLPythonAbstractNetworkTrainingSession.java:178)
at org.knime.dl.core.training.DLAbstractNetworkTrainingSession.run(DLAbstractNetworkTrainingSession.java:273)
at org.knime.dl.keras.base.nodes.learner.DLKerasLearnerNodeModel.executeInternal(DLKerasLearnerNodeModel.java:712)
… 14 more
Caused by: org.knime.python2.kernel.PythonIOException: ‘str’ object has no attribute ‘decode’
Traceback (most recent call last):
File “”, line 3, in
File “C:\Program Files\KNIME\plugins\org.knime.dl.keras_4.3.0.v202012011122\py\DLTF2NetworkReader.py”, line 126, in read
return read_keras(self.backend, path, compile, compatibility_mode)
File “C:\Program Files\KNIME\plugins\org.knime.dl.keras_4.3.0.v202012011122\py\DLTF2NetworkReader.py”, line 92, in read_keras
}[backend](path, compile, compatibility_mode)
File “C:\Program Files\KNIME\plugins\org.knime.dl.keras_4.3.0.v202012011122\py\DLTF2NetworkReader.py”, line 98, in read_keras_tensorflow
compatibility_mode=compatibility_mode)
File “C:\Program Files\KNIME\plugins\org.knime.dl.keras_4.3.0.v202012011122\py\DLKerasTensorFlowNetwork.py”, line 60, in read
model = self._read_internal(path, compile)
File “C:\Program Files\KNIME\plugins\org.knime.dl.keras_4.3.0.v202012011122\py\DLKerasNetwork.py”, line 100, in _read_internal
return load_model(path, compile=compile)
File “C:\Users\kimhw\anaconda3\lib\site-packages\keras\models.py”, line 269, in load_model
model_config = json.loads(model_config.decode(‘utf-8’))
AttributeError: ‘str’ object has no attribute ‘decode’

at org.knime.python2.util.PythonUtils$Misc.executeCancelable(PythonUtils.java:297)
at org.knime.python2.kernel.PythonKernel.executeCommandCancelable(PythonKernel.java:1479)
at org.knime.python2.kernel.PythonKernel.execute(PythonKernel.java:1410)
at org.knime.dl.python.core.DLPythonAbstractContext.executeInKernel(DLPythonAbstractContext.java:168)
at org.knime.dl.keras.core.DLKerasAbstractCommands.loadNetworkInternal(DLKerasAbstractCommands.java:161)
at org.knime.dl.keras.core.DLKerasAbstractCommands.loadNetwork(DLKerasAbstractCommands.java:132)
at org.knime.dl.keras.core.DLKerasAbstractNetworkLoader.loadInternal(DLKerasAbstractNetworkLoader.java:168)
... 19 more

Caused by: org.knime.python2.kernel.PythonIOException: ‘str’ object has no attribute ‘decode’
Traceback (most recent call last):
File “”, line 3, in
File “C:\Program Files\KNIME\plugins\org.knime.dl.keras_4.3.0.v202012011122\py\DLTF2NetworkReader.py”, line 126, in read
return read_keras(self.backend, path, compile, compatibility_mode)
File “C:\Program Files\KNIME\plugins\org.knime.dl.keras_4.3.0.v202012011122\py\DLTF2NetworkReader.py”, line 92, in read_keras
}[backend](path, compile, compatibility_mode)
File “C:\Program Files\KNIME\plugins\org.knime.dl.keras_4.3.0.v202012011122\py\DLTF2NetworkReader.py”, line 98, in read_keras_tensorflow
compatibility_mode=compatibility_mode)
File “C:\Program Files\KNIME\plugins\org.knime.dl.keras_4.3.0.v202012011122\py\DLKerasTensorFlowNetwork.py”, line 60, in read
model = self._read_internal(path, compile)
File “C:\Program Files\KNIME\plugins\org.knime.dl.keras_4.3.0.v202012011122\py\DLKerasNetwork.py”, line 100, in _read_internal
return load_model(path, compile=compile)
File “C:\Users\kimhw\anaconda3\lib\site-packages\keras\models.py”, line 269, in load_model
model_config = json.loads(model_config.decode(‘utf-8’))
AttributeError: ‘str’ object has no attribute ‘decode’

at org.knime.python2.kernel.PythonKernel.executeCommand(PythonKernel.java:1468)
at org.knime.python2.kernel.PythonKernel.execute(PythonKernel.java:1394)
at org.knime.python2.kernel.PythonKernel.lambda$5(PythonKernel.java:1410)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Hallo @zhddhkdn,

could you maybe share your workflow or the configurations of the Keras Network Learner node? This would make it easier to identify the problem.

Kind regards,
Janina