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

rnn_cell has no BasicLSTMCell #6432

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

rnn_cell has no BasicLSTMCell #6432

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


Copy link

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?

Copy link

gunan commented Dec 21, 2016

You can use BasicLSTMCell through

I was able to verify this in 0.12

@gunan gunan closed this as completed Dec 21, 2016
Copy link

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 "", line 362, in
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/", line 30, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "", line 324, in main
m = PTBModel(is_training=True, config=config, input_=train_input)
File "", 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/", line 166, in zero_state
for s in state_size_flat]
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/", 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/", line 815, in as_shape
return TensorShape(shape)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/", line 448, in init
self._dims = [as_dimension(dims)]
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/", line 374, in as_dimension
return Dimension(value)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/", 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 as completed Dec 22, 2016
Copy link

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?

Copy link

nealwu commented Dec 27, 2016

@sharod I think I saw you open an issue in and close it later -- did you end up figuring it out?

Copy link

userljw commented Dec 25, 2017

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

Copy link

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
None yet
None yet

No branches or pull requests

5 participants