Join us on July 16th as we explore real-world Reinforcement Learning Learn more

Deep Learning for Time Series

Level 1
Deep Learning for Time Series


I am trying to implement Deep Learning for Time Series tutorial provided here. I am using python 2.7 code environment with all the required deep learning packages installed. When I try to train the model it fails with the following message:

Training Failed… Sorry

Failed to train : <type 'exceptions.NameError'> : global name 'Reshape' is not defined


[2018-09-28 12:54:33,664] [23661/MainThread] [INFO] [root] START - Fitting model
/home/local/CD2/-sysop-nizaf1/dataiku/data-dss/code-envs/python/PriceCurveSeries/local/lib/python2.7/site-packages/h5py/ FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
[2018-09-28 12:54:34,226] [23661/MainThread] [INFO] [root] END - Fitting model
Traceback (most recent call last):
File "/home/local/CD2/-sysop-nizaf1/dataiku/dataiku-dss-5.0.1/python/dataiku/doctor/", line 47, in serve
ret = api_command(arg)
File "/home/local/CD2/-sysop-nizaf1/dataiku/dataiku-dss-5.0.1/python/dataiku/doctor/", line 45, in aux
return api(**kwargs)
File "/home/local/CD2/-sysop-nizaf1/dataiku/dataiku-dss-5.0.1/python/dataiku/doctor/", line 406, in train_prediction_keras
File "/home/local/CD2/-sysop-nizaf1/dataiku/dataiku-dss-5.0.1/python/dataiku/doctor/", line 310, in prediction_train_model_keras
File "/home/local/CD2/-sysop-nizaf1/dataiku/dataiku-dss-5.0.1/python/dataiku/doctor/deep_learning/", line 83, in get_keras_model
model = build_model(input_shapes, output_num_labels)
File "<string>", line 16, in build_model
NameError: global name 'Reshape' is not defined
[2018/09/28-12:54:34.226] [MRT-496] [INFO] [] - Check result for nullity exceptionIfNull=true result=null
[2018/09/28-12:54:34.331] [KNL-python-single-command-kernel-monitor-500] [INFO] [dku.kernels] - Process done with code 0
[2018/09/28-12:54:34.332] [KNL-python-single-command-kernel-monitor-500] [INFO] [] - Destroying API ticket for analysis-ml-PRICESERIES-UMRJunb on behalf of admin
[2018/09/28-12:54:34.332] [MRT-496] [INFO] [dku.kernels] - Getting kernel tail
[2018/09/28-12:54:34.333] [MRT-496] [INFO] [dku.kernels] - Trying to enrich exception: Failed to train : <type 'exceptions.NameError'> : global name 'Reshape' is not defined from kernel com.dataiku.dip.analysis.coreservices.AnalysisMLKernel@41fd0e04 process=null pid=?? retcode=0
[2018/09/28-12:54:34.333] [MRT-496] [WARN] [] - Training failed Failed to train : <type 'exceptions.NameError'> : global name 'Reshape' is not defined
[2018/09/28-12:54:34.335] [FT-TrainWorkThread-Db0YPUpu-495] [INFO] [] T-y31YyWbN - Processing thread joined ...
[2018/09/28-12:54:34.335] [FT-TrainWorkThread-Db0YPUpu-495] [INFO] [] T-y31YyWbN - Joining processing thread ...
[2018/09/28-12:54:34.335] [FT-TrainWorkThread-Db0YPUpu-495] [INFO] [] T-y31YyWbN - Processing thread joined ...
[2018/09/28-12:54:34.335] [FT-TrainWorkThread-Db0YPUpu-495] [INFO] [dku.analysis.prediction] T-y31YyWbN - Train done
[2018/09/28-12:54:34.336] [FT-TrainWorkThread-Db0YPUpu-495] [INFO] [dku.analysis.prediction] T-y31YyWbN - Train done
[2018/09/28-12:54:34.338] [FT-TrainWorkThread-Db0YPUpu-495] [INFO] [dku.analysis.prediction] T-y31YyWbN - Publishing mltask-train-done reflected event



0 Kudos
1 Reply

Hi, the first line of the Architecture code should be updated to read:

from keras.layers import Input, Dense, LSTM, Reshape

... by default, the LSTM and Reshape layers aren't imported.


0 Kudos
Labels (2)