我正在尝试理解使用RNN-LSTM的时间序列,并在此处在线找到此代码:https://github.com/mouradmourafiq/tensorflow-lstm-regression
但是,在尝试在v0.12下运行时,我遇到了这些错误。我该如何解决这个错误?
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/monitors.py:320 in __init__.: __init__ (from tensorfl
ow.contrib.learn.python.learn.monitors) is deprecated and will be removed after 2016-12-05.
Instructions for updating:
Monitors are deprecated. Please use tf.train.SessionRunHook.
WARNING:tensorflow:From lstm_trend.py:48 in <module>.: calling fit (from tensorflow.contrib.learn.python.learn.estimators.estimator) with x is deprecated
and will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
WARNING:tensorflow:From lstm_trend.py:48 in <module>.: calling fit (from tensorflow.contrib.learn.python.learn.estimators.estimator) with y is deprecated
and will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
WARNING:tensorflow:From lstm_trend.py:48 in <module>.: calling fit (from tensorflow.contrib.learn.python.learn.estimators.estimator) with batch_size is de
precated and will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
Traceback (most recent call last):
File "lstm_trend.py", line 48, in <module>
regressor.fit(X['train'], y['train'],monitors=[validation_monitor],batch_size=BATCH_SIZE,steps=TRAINING_STEPS)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/deprecation.py", line 191, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 355, in fit
max_steps=max_steps)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 699, in _train_model
train_ops = self._get_train_ops(features, labels)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1052, in _get_train_ops
return self._call_model_fn(features, labels, model_fn_lib.ModeKeys.TRAIN)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1023, in _call_model_fn
model_fn_results = self._model_fn(features, labels)
File "/home/username/rtw-rnn/lstm_model.py", line 122, in _lstm_model
output = dnn_layers(output[-1], dense_layers)
File "/home/username/rtw-rnn/lstm_model.py", line 114, in dnn_layers
return learn.ops.dnn(input_layers, layers)
AttributeError: 'module' object has no attribute 'dnn'
答案 0 :(得分:1)
我将框架更改为v0.10.0并且它正在运行。