Loading python model (.pkl ) from server with Python Script/Source Node

Hi, I am trying to load a python trained model in format .pkl from the KNIME server but the Python script node doesn’t see it when I provide either the absolute or mountpoint-relative url. I get the “No such file or directory” error.
I tried the solution of creating a nested workflow group locally and deploying together the models and the workflow to the server but still when providing a relative-mountpoint url the node fails. Any suggestion?

Thank you

Hi @Riccardo7,

The Python nodes do not support knime:// URLs. A workaround would be to resolve the URL to a local file path using e.g. the URL to File Path (Variable) – KNIME Community Hub node and then feeding the flow variable containing the resolved path to the Python node. There, the file path will be available in the flow_variables dictionary (e.g. via flow_variables['file_path']).

Here’s a really simple example that illustrates the idea: resolve_knime_url_for_python_nodes – KNIME Community Hub.

Marcel

4 Likes

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