DL Python Network Learner

@Asa_66

I think most of the examples are based on the Kaggle dataset “Cats and Dogs”:


Я думаю, что большинство примеров основано на наборе данных Kaggle “Кошки и собаки”:

[Переведено с английского с помощью deepl.com].

1 Like

Thank you @mlauber71.

@Asa_66: According to the workflow description this is the data which was originally used. Did you use the same dataset?

1 Like

Катрин. Все выяснилось. Удалось таки скачать правильные данные25000 с Dogs vs. Cats | Kaggle и все отработало. Ранее не подтверждали телефон. К сожалению результат неточный, всего accuracy=0.502 (собак определить не смогли). на другом наборе где всего 2000 изображений, точность та же но кошек отделить не вышло

Hi @Asa_66,

thank you for the update :slight_smile: good to hear that it works now :slight_smile:

The defined example network structure is quite small and it is only trained tor 5 epochs. This explains the low accuracy. A common approach for image classification is transfer learning. The next two workflows in the same workflow group show, how VGG16 can be used as pre-trained network. This should improve the accuracy.

Cheers
Kathrin

1 Like

Спасибо Кэтрин!
для начала добавлю эпох, потом новых процессов

Katrin.
what is the problems:
03_train-tune_vGG16_Python
in DL Python Network Creator execute faled: module ‘keras’ has no attribute ‘application’
02_train_simple_CNN
execute faled: EndVector() takes 1 positioonal arguments but 2 were given
thanks

Hi @Asa_66,

hm, I can’t reproduce the issues on my laptop.

Did you make any changes to the workflows? If yes, what did you change?
Did you setup your Python Deep Learning preferences? And have you been able to execute other deep learning workflows?

Cheers
Kathrin

@Asa_66 as it happens I have adapted some of the Workflows about cats and dogs and addaed a Python Environment Propagation:

There altough is a problem with the 03 example. I was not able to create an Environment Propagation - becaue the moment I use a user defined one some items from the basic KNIME Python Image integration are not there anymore:

I didn’t make any changes. I’ve only watched 02_train_simple_CNN so far. DL Python Network Creator worked after replacing the link instead of the local Python 3.9.7 with Anaconda 3.11 on different datasets (accuracy 0.587).

03_train-tune_vGG16_Python
in DL Python Network Creator (after F8 )

module ‘keras’ has no attribute ‘applications’

Traceback (most recent call last):

File “”, line 6, in

AttributeError: module ‘keras’ has no attribute ‘applications’

Thanks for the update!

Have you already setup your Python Environment for Deep Learning as described here:

https://docs.knime.com/2019-06/deep_learning_installation_guide/index.html#_configure_python_for_knime_deep_learning

Cheers
Kathrin

Katrin.
already setup Python Environment for Deep Learning as described.
03_train-tune_vGG16_Python *DL Python Network Creator (Download network from Keras.)
if f you press F8 (reset), then F7 : Error
module ‘keras’ has no attribute ‘applications’
Traceback (most recent call last):
File “”, line 6, in
AttributeError: module ‘keras’ has no attribute ‘applications’

Cause
anaconda 3-2021.11 tensorflow library (2.6), but max allowed is 2.00?

@Asa_66 you might want to try this adaption of the original with the Conda Environment Propagation with settings that should work on MacOSX or Windows:

@Kathrin - it might be an idea to provide YAML files or Conda Environment Propagations (like in your example here :slight_smile: ) for the Deep Learning examples since sometimes it is hard to find the right combination that would be compatible with the KNIME version.

Thanks, I’ve tried. but the error is the same when loading the pretrained network

Hi @Asa_66,

hm that is strange.

Can you please try the following workflow:

Here the model is already included.

Cheers
Kathrin

Katrin/
This process has always worked, does not work with pre-prepared network 3_train-tune_vGG16_Python *DL Python Network Creator (Download network from Keras)
namely the line
output_network = keras.applications.vgg16.VGG16(include_top=False, weights=‘imagenet’, input_tensor=None, input_shape=(150,150,3), pooling=None, classes=2)
(error text above)
conda 4.10.3
keras 2.6.0
tensorflow 2.6.0 ( required <=2.00) ??

Hi @Asa_66,

Could you check on your Python Deep Learning preference page (File > Preferences > KNIME > Python Deep Learning) whether the entry Library used for the “DL Python” scripting nodes is set to Keras, set it accordingly if necessary, and retry?

Some context: The DL Python scripting nodes can be used with both Keras/TensorFlow 1 and TensorFlow 2. It seems as if you would try to use one with Keras/TensorFlow 1 while the preferences point the node to a TensorFlow 2 environment.

Marcel

1 Like

@Asa_66 you will have to finde the right combination of Python versions and Kerr’s/Tensor Flow versions - not every combination will be compatible - therefore I recommend reading the links and examples that I have provided again. You will have to find the right combination

@MarcelW what would be great if KNIME could provide consistent recommendations with conda-forge (licensing) based YAML files and Conda Environment propagations for Windows, MacOSX and Linux for several scenarios - I have tried to come up with some examples based on the ones on the hub but it is maybe not so easy to follow them. I know KNIME is working on deeper integration with Anaconda but such examples might still be useful.

Unfortunately,
tensorflow 2
replacement did not helped

The example shows that they worked successfully in a combination of Python 3.9.7
KNIME 4.5.0 Anaconda 4.3.11
I have respectively 3.9.7, 4.5.1, 4.3.10
How important is that Keras 2.6.0, and the version of Knime requires < 2.0?

in the process with fine tuning, network Creditor worked
in combination with
anaconda 4.11.0
python 3.8.12
keras 2.4.3
tensorflow 2.3.0
knime 4.5.0
but node:
DL Python
Network Learner
execution error:
python program terminated
exeption occurred while running Python kernel