Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected int for argument 'axis' not <tf.Tensor 'input:0' shape=(?, 10, 1) dtype=float64>. #3

Open
sherlockhoatszx opened this issue Dec 19, 2016 · 0 comments

Comments

@sherlockhoatszx
Copy link

in the lstm_predictor.py file , i change to the tf.unpack. But still error pops out: Expected int for argument 'axis' not <tf.Tensor 'input:0' shape=(?, 10, 1) dtype=float64>.

def lstm_model(X, y):
stacked_lstm = tf.nn.rnn_cell.MultiRNNCell(lstm_cells(rnn_layers), state_is_tuple=True)
**x
= tf.unpack(1, time_steps, X)**

full version of error report:

File "", line 1, in
runfile('/home/sherlock/Downloads/TensorFlow-Tutorials-for-Time-Series-master/lstm-for-epf.py', wdir='/home/sherlock/Downloads/TensorFlow-Tutorials-for-Time-Series-master')

File "/usr/local/lib/python2.7/dist-packages/spyder/utils/site/sitecustomize.py", line 866, in runfile
execfile(filename, namespace)

File "/usr/local/lib/python2.7/dist-packages/spyder/utils/site/sitecustomize.py", line 94, in execfile
builtins.execfile(filename, *where)

File "/home/sherlock/Downloads/TensorFlow-Tutorials-for-Time-Series-master/lstm-for-epf.py", line 42, in
regressor.fit(X['train'], y['train'], monitors=[validation_monitor], logdir=LOG_DIR)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/base.py", line 257, in fit
monitors=monitors)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 662, in _train_model
train_op, loss_op = self._get_train_ops(features, targets)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 963, in _get_train_ops
_, loss, train_op = self._call_model_fn(features, targets, ModeKeys.TRAIN)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 946, in _call_model_fn
return self._model_fn(features, targets, mode=mode)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/base.py", line 493, in _model_fn
predictions, loss = model_fn(features, targets)

File "lstm_predictor.py", line 116, in lstm_model
x
= tf.unpack(1, time_steps, X)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 799, in unpack
return gen_array_ops._unpack(value, num=num, axis=axis, name=name)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 3023, in _unpack
name=name)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 666, in apply_op
attr_value.i = _MakeInt(value, key)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 155, in _MakeInt
(arg_name, repr(v)))

TypeError: Expected int for argument 'axis' not <tf.Tensor 'input:0' shape=(?, 10, 1) dtype=float64>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant