Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

AttributeError: BasicLSTMCell is not available with Keras 3. #2876

@mr-lln

Description

@mr-lln

WARNING:tensorflow:From C:\Users\11223\AppData\Local\Programs\Python\Python312\Lib\site-packages\tensorflow\python\compat\v2_compat.py:98: disable_resource_variables (from tensorflow.python.ops.resource_variables_toggle) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term
Traceback (most recent call last):
File "C:\Users\11223\Desktop\main.py", line 498, in
ue_RL_list.append(DuelingDoubleDeepQNetwork(env.n_actions, env.n_features, env.n_lstm_state, env.n_time,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
line 54, in init
self._build_net()
line 150, in _build_net
self.q_eval = build_layers(self.s, self.lstm_s, c_names, n_l1, n_lstm, w_initializer, b_initializer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
, line 86, in build_layers
lstm_dnn = tf.compat.v1.nn.rnn_cell.BasicLSTMCell(n_lstm)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11223\AppData\Local\Programs\Python\Python312\Lib\site-packages\tensorflow\python\util\lazy_loader.py", line 207, in getattr
raise AttributeError(
AttributeError: BasicLSTMCell is not available with Keras 3.

Do I need to roll back a version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions