Deep Learning for Time Series
farrukhnizami
Registered Posts: 1 ✭✭✭✭
Hi,
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
Log:
[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/__init__.py:36: 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/server.py", line 47, in serve
ret = api_command(arg)
File "/home/local/CD2/-sysop-nizaf1/dataiku/dataiku-dss-5.0.1/python/dataiku/doctor/dkuapi.py", line 45, in aux
return api(**kwargs)
File "/home/local/CD2/-sysop-nizaf1/dataiku/dataiku-dss-5.0.1/python/dataiku/doctor/commands.py", line 406, in train_prediction_keras
pipeline.generated_features_mapping)
File "/home/local/CD2/-sysop-nizaf1/dataiku/dataiku-dss-5.0.1/python/dataiku/doctor/prediction_entrypoints.py", line 310, in prediction_train_model_keras
generated_features_mapping)
File "/home/local/CD2/-sysop-nizaf1/dataiku/dataiku-dss-5.0.1/python/dataiku/doctor/deep_learning/keras_support.py", 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] [dku.block.link.interaction] - 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] [dip.tickets] - 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: com.dataiku.dip.io.SocketBlockLinkKernelException: 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] [dku.analysis.ml.python] - Training failed
com.dataiku.dip.io.SocketBlockLinkKernelException: Failed to train : <type 'exceptions.NameError'> : global name 'Reshape' is not defined
at com.dataiku.dip.io.SocketBlockLinkInteraction.throwExceptionFromPython(SocketBlockLinkInteraction.java:298)
at com.dataiku.dip.io.SocketBlockLinkInteraction$AsyncResult.checkException(SocketBlockLinkInteraction.java:215)
at com.dataiku.dip.io.SocketBlockLinkInteraction$AsyncResult.get(SocketBlockLinkInteraction.java:190)
at com.dataiku.dip.io.SingleCommandKernelLink$1.call(SingleCommandKernelLink.java:208)
at com.dataiku.dip.analysis.ml.prediction.PredictionTrainAdditionalThread.process(PredictionTrainAdditionalThread.java:75)
at com.dataiku.dip.analysis.ml.shared.PRNSTrainThread.run(PRNSTrainThread.java:130)
[2018/09/28-12:54:34.335] [FT-TrainWorkThread-Db0YPUpu-495] [INFO] [dku.analysis.ml.python] T-y31YyWbN - Processing thread joined ...
[2018/09/28-12:54:34.335] [FT-TrainWorkThread-Db0YPUpu-495] [INFO] [dku.analysis.ml.python] T-y31YyWbN - Joining processing thread ...
[2018/09/28-12:54:34.335] [FT-TrainWorkThread-Db0YPUpu-495] [INFO] [dku.analysis.ml.python] 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
Regards
Farrukh
Tagged:
Best Answer
-
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.