I am having a lot or trouble trying to install and integrate Python and Keras with Knime for a MAC Book Pro.
I can run Keras and Python fine inside my Anaconda environment and I have made the environment in Anaconda = py35_knime and can see python and all extension in the py35_knime environment in Anaconda?
It seems that there is a problem with your Python configuration. Can you paste the .sh script you created and pointed the python preference page to? This will help us debugging your problem!
OK, maybe that is the part I am not clear on … the exact script, where to place it etc. etc. … sorry can you put a simple step by step explanation of these instructions … thank you.
My shell script for the Python environment (is below) I named this script py35.sh, tried to make it executable (“chmod gou+x py35.sh”), and put it in my home directory?? (maybe I put in in the wrong place - I put it in the /Users/xxxxx/anaconda3/py35.sh directory??)
In order to use this new Python environment from inside of KNIME, you need to create a script (shell script on linux and the Mac, bat file on Windows) to launch it.
If you are using linux or the Mac, here’s an example shell script for the Python environment defined above:
#! /bin/bash
start by making sure that the anaconda directory is on the PATH
You will need to edit that to replace PATH_WHERE_YOU_INSTALLED_ANACONDA with wherever you installed Anaconda. I named this script py35.sh, made it executable (“chmod gou+x py35.sh”), and put it in my home directory.
you have to point the entry in the KNIME preference page on the .sh file and also make sure to install the keras extension into your python environment (see http://knime.com/deeplearning).
OK, I think I got it to work … Keras and Tensorflow work for me for: knime://EXAMPLES/04_Analytics/14_Deep_Learning/02_Keras/01_Classify_images_using_InceptionV3
But now I have a new problem that have been trying many things but does not seem to work for the below?!?!
List Files Node Not Working For: /01_Pre-process_image_data to classify cats and dogs
After I download the cats/dogs data from Kaggle I can see the files of images in the folder with cats.jpg first then dogs.jpg files on the bottom of the file list (see screen shot on bottom). But when I try to upload the files (or zip folder) the first node (List Files) mixes up the order of the files … see first image below Then when I use the next node (Rule Engine) the first 12500 rows get classified as cats (no matter if they are a cat or dog image? Either need to fix the List Files node or change the java script in the Rule Engine node?? Any suggestions is greatly appreciated … thank you.
The images are not normalized and therefore displayed in grey, but the information is there. You can use the “Image Normalizer” to normalize them. However, for learning it’s important to use them as they are.
thank you for getting back to me so soon!!!.. after when I save the processed data and try the workflow below the accuracy comes out at 50% … for some reason it is not seeing the images. Maybe I don’t have the tensorflow set up right for my MacBook Pro using High Sierra … don’t have GPU just CPU … see image and log below.
WARN RowID 2:224 No row key column selected generate a new one
WARN RowID 2:224 No row key column selected generate a new one
WARN RowID 2:224 No row key column selected generate a new one
WARN PythonKernel Using TensorFlow backend.
WARN PythonKernel 2018-03-23 11:22:11.440348: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
WARN RowID 2:224 No row key column selected generate a new one
WARN PythonKernel Using TensorFlow backend.
WARN PythonKernel 2018-03-23 11:22:50.937370: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
WARN PythonKernel /Users/tracy/anaconda3/envs/py35_knime/lib/python3.5/site-packages/keras/models.py:252: UserWarning: No training configuration found in save file: the model was not compiled. Compile it manually.
WARN PythonKernel warnings.warn('No training configuration found in save file: ’
WARN PythonKernel Using TensorFlow backend.
WARN PythonKernel 2018-03-23 11:23:43.319876: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
WARN RowID 3:232 No row key column selected generate a new one
WARN RowID 3:232 No row key column selected generate a new one
WARN PythonKernel Using TensorFlow backend.
WARN PythonKernel 2018-03-24 20:29:20.682779: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
WARN PythonKernel /Users/tracy/anaconda3/envs/py35_knime/lib/python3.5/site-packages/keras/models.py:252: UserWarning: No training configuration found in save file: the model was not compiled. Compile it manually.
WARN PythonKernel warnings.warn('No training configuration found in save file: ’
In the 04_Cats_and_Dogs Train _Simple_CNN model the DLPythonNetworkExecutor all the numbers come out above 0.5 and get predicted as dogs?? (see image below)… why? Why is this not working?
I’m not sure if I understand what you mean by “seeing”. Keep in mind, there is no tensorflow / keras support for GPU on macOS.
The “Simple CNN” isn’t expected to perform very well. However, there should be some “cats” in there as well How many epochs and how many batches did you actually train your network?
what does the below error message mean? Does the compile section of code need updating ???
Using TensorFlow backend.
2018-03-26 09:59:00.481670: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
/Users/tracy/anaconda3/envs/py35_knime/lib/python3.5/site-packages/keras/models.py:252: UserWarning: No training configuration found in save file: the model was not compiled. Compile it manually.
warnings.warn('No training configuration found in save file: ’
ERROR PythonKernel Exception ignored in: <bound method BaseSession.del of <tensorflow.python.client.session.Session object at 0x115736470>>
ERROR PythonKernel TypeError: ‘NoneType’ object is not callable
ok, maybe i figured it out … do I need to hit the Execute Script button in the Python Network Learner Node (i.e. manual execution) … says 5 Epochs with 2000 steps each … will take over 2 hours ETA?!? mac laptop can’t handle this?!?