Python module error while running KERAS Network Learner node

Hello all,
I am trying to run the workflow for the example “Glucose TSA” available in the Codeless Time Series Analysis with KNIME space in KAP 5.1.1 on my laptop.

Running the workflow fails the Network Learner Node with the following message -

Traceback (most recent call last):
File “”, line 2, in
File “C:\Program Files\KNIME\plugins\org.knime.dl.python_5.1.0.v202303061416\py\DLPythonNetwork.py”, line 53, in
from pandas.util.testing import network
ModuleNotFoundError: No module named ‘pandas.util.testing’

I checked the py file in the specified location. There is statement in the file as below
from pandas.util.testing import network

I checked ChatGPT and it advised to remove this statement. I ran the code file post removing this statement on my machine and in the same environment. I did not get any error.

The import from pandas.util.testing import network is problematic as pandas.util.testing was deprecated and later removed in newer versions of pandas. Since there’s no reference to network in the rest of the code, this line can be safely removed.

Can I please request if the KNIME team can check the same and help to resolve the error?

Any help and steer is highly appreciated.


Best Regards,
nilotpalc

@nilotpalc as a quick hint you will have to set up the necessary Python packages in versions compatible with the current knime nodes

https://docs.knime.com/latest/deep_learning_installation_guide/index.html

1 Like

Thanks @mlauber71
I had created a separate environment in conda specific to KNIME DL.
Let me follow the steps and use the ‘new environment’ within Preferences to create a new environment and see if the error goes away.


Best Regards,
nilotpalc

1 Like

Hello @mlauber71
I created new environment for KERAS following the instructions in the guide.
I am now getting the below mentioned error.

I am not a pro-python user and hence, unable to understand the errors indicating a metaclass conflict.

Is this possibly linked to my other environments?


Best Regards,
nilotpalc

@nilotpalc setting up DL environment sis not easy unfortunately. You can do these things: Set up conda and just use these two metanodes:

Or if this fails read this article:

2 Likes

Hi @mlauber71
Thank you for sharing the above links.
I primarily decided to use the component for Keras environment creation.

It was able to successfully create the environment and there were no errors in running the workflow specific to the Keras Learner Node.
image

I also created a yml file basis the annotation inside the component and created a fresh environment. I configured the new environment in the KNIME preferences for Keras .The newly created environment also worked without any errors.

For new users visiting this post, please make sure to change the configuration in the Learner Node in case you are switching between the configuration component and Knime preferences.
image

Other key takeaway from this experience is the creation of the environment through the Preferences → Python Deep Learning → New Environment method as elaborated in the Installation guide works fine for Tensor Flow 2 as shared above.

@mlauber71 Once again, thanks for all the guidance.


Best Regards,
nilotpalc

2 Likes

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