Community Conundrums are live! Learn more

Keras/Tensorflow Model fails "ImportError: No module named tensorflow"

Level 1
Keras/Tensorflow Model fails "ImportError: No module named tensorflow"

Hi there guys!

I just installed Dataiku on MacOS (so gpu processing is not supported).

Trying to build a Deep learning model with keras and tensorflow, got an import error for tensorflow (using the default configuration/script).

Is there something I'm doing wrong?

Your help would be much appreciated.

The error:

[2019-05-23 15:57:36,358] [65612/MainThread] [INFO] [root] END - Fitting preprocessors
[2019-05-23 15:57:36,358] [65612/MainThread] [INFO] [root] START - Preprocessing train set
[2019-05-23 15:57:36,358] [65612/MainThread] [INFO] [root] END - Preprocessing train set
[2019-05-23 15:57:36,358] [65612/MainThread] [INFO] [root] START - Preprocessing test set
[2019-05-23 15:57:36,363] [65612/MainThread] [INFO] [root] END - Preprocessing test set
[2019-05-23 15:57:36,365] [65612/MainThread] [INFO] [root] START - Fitting model
[2019-05-23 15:57:36,367] [65612/MainThread] [INFO] [root] END - Fitting model
Traceback (most recent call last):
File "/Applications/", line 47, in serve
ret = api_command(arg)
File "/Applications/", line 45, in aux
return api(**kwargs)
File "/Applications/", line 419, in train_prediction_keras
File "/Applications/", line 350, in prediction_train_model_keras
File "/Applications/", line 26, in get_keras_model
[2019/05/23-15:57:36.367] [MRT-1323] [INFO] [] - Check result for nullity exceptionIfNull=true result=null
from import gpu
File "/Applications/", line 5, in <module>
import tensorflow as tf
ImportError: No module named tensorflow
[2019/05/23-15:57:36.462] [KNL-python-single-command-kernel-monitor-1327] [INFO] [dku.kernels] - Process done with code 0
[2019/05/23-15:57:36.465] [KNL-python-single-command-kernel-monitor-1327] [INFO] [] - Destroying API ticket for analysis-ml-ENERGY_PREDICTION_V1-kbMnWwD on behalf of admin
[2019/05/23-15:57:36.466] [MRT-1323] [INFO] [dku.kernels] - Getting kernel tail
[2019/05/23-15:57:36.467] [MRT-1323] [INFO] [dku.kernels] - Trying to enrich exception: Failed to train : <type 'exceptions.ImportError'> : No module named tensorflow from kernel com.dataiku.dip.analysis.coreservices.AnalysisMLKernel@6a50edbb process=null pid=?? retcode=0
[2019/05/23-15:57:36.467] [MRT-1323] [WARN] [] - Training failed Failed to train : <type 'exceptions.ImportError'> : No module named tensorflow


0 Kudos
3 Replies
Level 2

Hello, for the error AttributeError: module tensorflow has no attribute placeholder

you may like to check this link.

0 Kudos

Hello Bogdan,

It seems that you did not install the proper code environment to be able to run deep learning models.

Dataiku DSS is not shipped directly with Keras and Tensorflow, but offers the possibility to easily install them, and then use them in the visual Machine learning, to run deep learning models.

The steps to setup the appropriate code environment are detailed in the "Prerequisites" part of this tutorial:

Don't hesitate to come back to us if you have troubles installing the environment.


Best regards,

Nicolas Servel

0 Kudos
Level 1
Thank you!
Installed the code env and got model to work.
0 Kudos
Labels (1)