Images into Keras Network Learner

Good afternoon,

Our intention is to use KNIME powered Keras nodes for CNN, however, to do this we need to input the images to “Keras Network Learner”. We tried with “list files/folders” and then with “read images” to input the images in our folder into the “Keras Network Learner”. We even tried to use a “path to string” node for inputting into “read images”, but it did not work. Finally we even tried “image reader (Table)” and still it did not work.

Could you please suggest us a way to read images from a folder and then input them into the “Keras Network Learner” node?

Hello,
what exactly did not work with the mentioned approaches? It would be helpful if you could attach a workflow with some sample data showing what is going on.

Meanwhile, please have a look at this workflow that should perform more or less what you are trying to do, using List Files/Folders and the Image Reader (Table) nodes .

Also, please make sure that you have installed all the required extensions to deal with images. In particular

2 Likes

Good afternoon,

thank you for your answer, we have managed to solve the issue, as it was a problem with the extensions of our images. However, we have now incurred in another problem: when we try to run the Keras Network Learner, we get the error “Tensors are unhashable”. I am including the screenshot of the error.

Glad that you solved your first problem!

I have no experience with the issue you’re facing at the moment, however a bit of googling around suggested it might be caused by version incompatibility. Is your Conda environment correctly set up? This guide shows all the steps to configure the environment for the Deep Learning extension. The recommended automatic configuration with Anaconda should be enough for your use case.

If this is not the case, please provide the workflow so we can try to replicate the issue.

1 Like

Thank you for your answer!

Unfortunately, we had already followed the steps of the guide you provided us, and the problem persists.

I am now sending you the workflow and a link to a sample of our images.

KNIME_project.knar.knwf (79.9 KB)

Link to images

I was able to execute the learning process locally without issues. Thus, I think it might actually be a configuration problem on your side.
One thing I noticed in your workflow: you are using a Conda Environment Propagation connected to the Keras Network Learner. However, the learner is configured to “Use KNIME Preferences” and therefore ignores the environment provided by the flow variable. Please make sure to use the correct environment. If you followed the guide with the default parameters, it should be named py3_knime_dl.
Also, you can check that this is the default environment for Keras under File → Preferences → KNIME → Python Deep Learning.

I hope this was helpful.

2 Likes