This document describes how to install the KNIME Deep Learning Integrations.
These integrations bring deep learning capabilities to KNIME Analytics Platform, which allow you to read, create, edit, train, and execute deep neural networks within KNIME Analytics Platform.
KNIME Deep Learning Integrations
Three different deep learning libraries have been integrated:
KNIME Keras Integration
KNIME Tensor Flow Integration
The KNIME TensorFlow Integration provides access to the powerful machine learning library TensorFlow* within KNIME. It enables you to read, write, train, and execute TensorFlow networks directly in KNIME. You can also convert your Keras networks to TensorFlow networks with this extension for even greater flexibility.
* TensorFlow, the TensorFlow logo and any related marks are trademarks of Google Inc.
KNIME Keras Integration Installation
This section describes how to install the KNIME Keras Integration for use with KNIME Analytics Platform.
Similar to the KNIME Python Integration, the KNIME Keras Integration internally uses an existing Python installation, which is installed alongside of KNIME and depends on certain Python packages that have to be installed. In this document we show how to setup the necessary Python installation and how to install the KNIME Keras Integration.
KNIME executes Keras in a local Python installation, which has to be set up manually. If you have already set up your Python installation, you can skip this step. We highly recommend setting up a
condaenvironment as described in our Python Installation Guide. In this guide you can either follow the Quickstart Section, or follow the Full Installation Section if you’d like to have a detailed walkthrough.
The KNIME Keras Integration only supports Python 3. Therefore it is necessary to set up Python 3.
Additionally to the Python packages installed in the previous step, the KNIME Keras Integration depends on further packages. If you are using Anaconda, they can be installed with a single command. The required packages are
tensorflow=1.12for GPU), and
keras-gpu=2.2.4for GPU). For the CPU version use the command:
conda install --name <your_env_name> h5py=2.8 tensorflow-mkl=1.12 keras=2.2.4
and for the GPU version the command:
conda install --name <your_env_name> h5py=2.8 tensorflow=1.12 keras-gpu=2.2.4
<your_env_name>is the name of your conda environment.
A general description about how to install further Python packages using Anaconda can be found here.
In case you run into problems within KNIME due to missing Keras dependencies or if you want to double check that everything was set up correctly, here is a list of Keras dependencies of Keras (these should have been installed automatically):
h5py (version: 2.8)
numpy (version: 1.15)
pyyaml (version: 3.13)
scipy (version: 1.1)
six (minimum version: 1.11)
tensorflow or tensorflow-gpu (version: 1.12)
If you are using Anaconda, you can check whether these dependencies are installed by running:
conda list -n <your_env_name>
<your_env_name> is the name of your conda environment.
Installing the KNIME Keras Integration
The KNIME Keras Integration extension can be installed using the KNIME Analytics Platform Update Site where it is listed under KNIME Labs Extensions. Alternatively, enter keras into the search box.
|If Keras is not displayed as an available deep learning back end, you may need to restart KNIME Analytics Platform.|
After you have set up Python and the KNIME Keras Integration is installed, you are ready to go.
For the KNIME Deep Learning Integration there are the following extensions:
Keras is able to accelerate deep learning models using a compatible NVIDIA® GPU via TensorFlow. Most of the required dependencies for GPU (i.e. CUDA® and cuDNN) will be automatically installed by Anaconda when installing the
keras-gpu=2.2.4. The only additional requirement that needs to be installed manually is the latest version of the NVIDIA® GPU driver.
KNIME TensorFlow Integration Installation
This section describes how to install the KNIME TensorFlow Integration for use with KNIME Analytics Platform.
The KNIME TensorFlow Integration can be installed using the KNIME Analytics Platform Update Site where it is listed under KNIME Labs Extensions. Alternatively, enter tensorflow into the search box.
|If TensorFlow is not displayed as an available deep learning back end, you may need to restart KNIME Analytics Platform.|
If you want to use TensorFlow models in DL Python nodes with custom Python scripts, you need a Python installation alongside KNIME. This Python installation has the same requirements as the KNIME Keras Integration. In order to install Python and the necessary dependencies, please refer to the Python Installation Section.
TensorFlow is able to accelerate deep learning models using a compatible NVIDIA® GPU. For detailed instructions on how to set up GPU support on your system, please refer to the official documentation. A list of supported GPU devices is also shown on the TensorFlow documentation page.
|Due to limitations by TensorFlow, the GPU support for the KNIME TensorFlow Integration can’t be used on Mac. Only Linux and Windows are supported.|
The versions of the required software for the GPU support of TensorFlow must be compatible with the installed TensorFlow version. The KNIME Keras Integration uses TensorFlow version
1.12, the following NVIDIA® software must be installed on your system:
KNIME Deeplearning4j Installation
This section explains how to install KNIME Deeplearning4j Integration to be used with KNIME Analytics Platform.
The KNIME Deepleraning4j Integration can be installed using the KNIME Analytics Platform Update Site where it is listed under KNIME Labs Extensions.
Older versions of KNIME Analytics Platform, used together with older versions of the KNIME Deep Learning Integrations dependencies, may lead to errors. These errors can be fixed by updating KNIME Analytics Platform and the KNIME Deep Learning Integrations to the latest versions. Furthermore, if you are using Python, please make sure to use the recommended conda package versions. The following issues are currently known:
Node fails with error AttributeError: '[..]' object has no attribute 'inbound_nodes' at the bottom of a Python traceback in the KNIME log (KNIME 3.5.x only).
Keras version 2.1.3 introduced breaking changes that were adapted in KNIME version 3.6.0. Please upgrade KNIME to version 3.6.0 or downgrade Keras to version 2.1.2 or below (minimum version: 2.0.7).
Node fails with error UnicodeEncodeError: 'ascii' codec can’t encode character [..] in position [..]: ordinal not in range(128) at the bottom of a Python traceback in the KNIME log.
This error may occur when using Keras version 2.1.2 to load a Keras network that was saved using an older Keras version. Make sure not to use Keras 2.1.2 in such cases.
Node fails with both an error SystemError: unknown opcode and a warning XXX lineno: [..], opcode: [..] in the KNIME log.
This is a Python related error that occurs when loading a Keras network containing a Lambda expression (e.g. within a Lambda layer) that was saved using a different Python version. Make sure you use the same Python version for saving and loading the same network.
DL Keras Network Learner fails with error AttributeError: 'int' object has no attribute 'dtype' at the bottom of a Python traceback in the KNIME log when the Clip norm option is enabled in the node dialog and Keras (TensorFlow) is the selected back end.
This is a TensorFlow related error that only occurs in very specific situations. Try to use a different Keras back end to work around this issue.
DL Python Network Executor scripting node outputs wrong numerical values when using Flatbuffers serialization library (KNIME 3.6.1 and older).
Flatbuffers in KNIME does not support float32 data at the moment. We recommend using Apache Arrow as serialization library instead. This option can be changed in KNIME via File → Preferences → KNIME → Python → Serialization library.