Keras + TensorFlow Extension Setup Issue in KNIME

Hi,

I’m trying to get the Keras + TensorFlow extension working in KNIME, but I haven’t been successful so far. I’ve been reading blogs, posts, and tried different combinations of Python, TensorFlow, and Keras setups through Conda environments, but I still encounter the same issue.

Here’s the error message I receive:

ERROR Keras Network Learner 4:910 Execute failed:  
An error occurred while creating the Keras network from its layer specifications. Details:  

An error occurred while trying to launch Python: invalid syntax (<string>, line 3)

The message also suggests that missing Python packages might be the cause:

“In case Python packages are missing, you can create a new Python Conda environment that contains all packages required by the KNIME Deep Learning integrations in the ‘KNIME Deep Learning’ Preferences.”

I tested other example workflows available through the KNIME community, such as “Building Sentiment Predictor – Deep Learning”, and which uses combinations of the Keras Embedding Layer, and the Keras Network Learner node runs without issues there.

Could you please help me identify what might be causing this problem or guide me through the correct setup process?

My current Conda environment is created:

(base) C:\Users\user>conda create -n knime-dl python=3.10

(knime-dl) C:\Users\user>pip install tensorflow==2.13 numpy pandas h5py

(knime-dl) C:\Users\user>pip install scikit-learn

All the installations went through smoothly with no error.

Thank you for your assistance.

Hey everyone, I wanted to share what worked for me with KNIME Keras network nodes. After a lot of trial and error, I found that this combination is stable and avoids most compatibility headaches:

  • Python: 3.7

  • TensorFlow: 1.15 (CPU version)

  • Keras: 2.2.x

  • Other important packages: NumPy 1.16, SciPy 1.2, Pandas 0.24, Matplotlib 3.0, Scikit-learn 0.20, h5py 2.10

  • Optional: py4j (needed for some KNIME Python integrations)

Pointing KNIME to a Python environment with these versions made all the Keras and Python nodes work smoothly for me. Hopefully this helps anyone struggling with version issues!

3 Likes

@afarrokh maybe you can share the full yaml file of your working environment and the KNIME version you used and the operating system. Getting deep learning to work is not easy unfortunately.

And with the GenAI hype the nodes have not received that much love and care.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.