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

rnn_cell has no BasicLSTMCell #6432

Closed
xu-song opened this Issue Dec 21, 2016 · 6 comments

Comments

Projects
None yet
5 participants
@xu-song

xu-song commented Dec 21, 2016

lstm_cell = tf.contrib.rnn.BasicLSTMCell(
AttributeError: 'module' object has no attribute 'BasicLSTMCell'.

Is it been replaced by other cell?

@gunan

This comment has been minimized.

Member

gunan commented Dec 21, 2016

You can use BasicLSTMCell through
tf.nn.rnn_cell.BasicLSTMCell

I was able to verify this in 0.12

@gunan gunan closed this Dec 21, 2016

@sharod

This comment has been minimized.

sharod commented Dec 22, 2016

gunan I hwas having the same problem as xusong2008 . I replaced tf.contrib.rnn.BasicLSTMCell by tf.nn.rnn_cell. BasicLSTMCell as you said but now a new error is being shown:

Traceback (most recent call last):
File "ptb_word_lm.py", line 362, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "ptb_word_lm.py", line 324, in main
m = PTBModel(is_training=True, config=config, input_=train_input)
File "ptb_word_lm.py", line 110, in init
self._initial_state = cell.zero_state(batch_size, data_type())
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell.py", line 166, in zero_state
for s in state_size_flat]
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell.py", line 79, in _state_size_with_prefix
result_state_size = tensor_shape.as_shape(state_size).as_list()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_shape.py", line 815, in as_shape
return TensorShape(shape)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_shape.py", line 448, in init
self._dims = [as_dimension(dims)]
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_shape.py", line 374, in as_dimension
return Dimension(value)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_shape.py", line 33, in init
self._value = int(value)
TypeError: int() argument must be a string or a number, not 'BasicLSTMCell'

Pls help soon !!

@gunan gunan reopened this Dec 22, 2016

@gunan gunan closed this Dec 22, 2016

@gunan

This comment has been minimized.

Member

gunan commented Dec 22, 2016

Looks like your is a breakage in one of the models in our models repository.
COuld you file an issue in tensorflow/models repository for a fix for that?

@nealwu

This comment has been minimized.

Member

nealwu commented Dec 27, 2016

@sharod I think I saw you open an issue in github.com/tensorflow/models and close it later -- did you end up figuring it out?

@userljw

This comment has been minimized.

userljw commented Dec 25, 2017

AttributeError: module 'tensorflow.contrib.rnn' has no attribute 'static_rnn'

@nealwu

This comment has been minimized.

Member

nealwu commented Dec 27, 2017

@userljw please upgrade your TensorFlow installation to 1.4. static_rnn should be available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment