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

The layer sequential_1 has never been called and thus has no defined {attr_name} #1

Open
AslanDevbrat opened this issue Jun 22, 2022 · 1 comment

Comments

@AslanDevbrat
Copy link

hey i was trying to reproduce your results. I just ran your code cell be by but i am getting the error

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
[<ipython-input-25-1ffcfad7c4a9>](https://localhost:8080/#) in <module>()
      1 lstm = model.layers[2]
----> 2 attn_func = K.function(inputs = [model.get_input_at(0), K.learning_phase()],
      3            outputs = [lstm.output]
      4           )

1 frames
[/usr/local/lib/python3.7/dist-packages/keras/engine/base_layer.py](https://localhost:8080/#) in _get_node_attribute_at_index(self, node_index, attr, attr_name)
   2699     """
   2700     if not self._inbound_nodes:
-> 2701       raise RuntimeError(f'The layer {self.name} has never been called '
   2702                          'and thus has no defined {attr_name}.')
   2703     if not len(self._inbound_nodes) > node_index:

RuntimeError: The layer sequential_1 has never been called and thus has no defined {attr_name}.
@enricgrau
Copy link

enricgrau commented Sep 21, 2022

@AslanDevbrat I'm having the same issue. Are you using the same versions? (i.e.:Python - 3.x, Keras - 2.2.5, Tensorflow - 1.15.0).
Also, check that you can use CuDNNLSTM as it is only for a GPU. Instead, try LSTM and see what happens.

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

2 participants