Execution Error in using Keras Network Learner

Hi,

I am trying to use Keras Network Learner for an image classification task, but I keep getting the following error:

ERROR Keras Network Learner 5:273 Execute failed: Method org/knime/ip/dl/DLImgPlusValueToFloatTensorConverterFactory.getDataShape(Ljava/util/List;Lorg/knime/dl/core/DLTensorSpec;)[J is abstract

I already ran the KNIME example 04_Fine_Tune_VGG16 and everything worked fine in there. So obviously it could not have to do with my python installation or KNIME Keras extension. Any idea what am I doing wrong?

Thanks

I guess I realized what is the problem, yet I don’t have any solution for that.
The problem is that I am using grayscale images and used the following settings to read, normalize, and resize them:




When I use the processed images as input to Python, however, it identifies them as two-dimensional arrays (150,150). While the Conv2D layer I am going to use in my deep network requires a three dimensional array (150,150,1) as input. Does anyone know how should I resolve this?

Thanks

Hi @behrooz12,
To add an dimension of size 1 to your images use the following node:
https://nodepit.com/node/org.knime.knip.base.nodes.proc.DimExtendNodeFactory%23Dimension%20Extender

best,
Gabriel

1 Like

Thanks, Gabriel. That solved the dimensions issue. Now when I open my images using Image Viewer it shows the channel dimension as well:
image
However, the Keras Network Learner error still exists.

ERROR Keras Network Learner 3:273 Execute failed: Method org/knime/ip/dl/DLImgPlusValueToFloatTensorConverterFactory.getDataShape(Ljava/util/List;Lorg/knime/dl/core/DLTensorSpec;)[J is abstract

Do you have any ideas what else could be the issue? Is it about the shape of input tensors?

Hi behrooz12,

I suspect your KNIME Image Processing - Deep Learning extension is out of sync for some reason. Could you try to update it via File > Update KNIME… or - if it’s already up to date - try to reinstall it? (First remove it via Help > About KNIME > Installation Details > Installed Software, then install it via File > Install KNIME Extensions…).
Please let me know if neither of these resolves the issue or if you have any questions about those steps.

Marcel