JRC1995 / Abstractive-Summarization

Implementation of abstractive summarization using LSTM in the encoder-decoder architecture with local attention.
MIT License
167 stars 59 forks source link

AttributeError: 'Operation' object has no attribute 'mark_used' in python 3.5 #8

Closed Sarthak-02 closed 5 years ago

Sarthak-02 commented 6 years ago

when i run this line of code, output = model(tf_text,tf_seq_len,tf_output_len) in Summarisation_model.ipynb

JRC1995 commented 6 years ago

I am not sure. The issue may be related to Tensorflow as opposed to plain pythoin 3.5. Check def forward_encoder and def backward_encoder. Both of them are called from within model(), and both of the functions has this line near the end:

hidden_residuals.close().mark_used()

Additionally, even def model() has this line towards the end:

hidden_residuals_d.close().mark_used()

These are where the issue resides, most probably.

I tested the code again. It works fine in my machine.

However, you can try removing the .mark_used() part altogether from those 3 lines and run again.

I implemented those because of a necessity. But I resolved the issue for which mark_used() was needed. So the .mark_used() part isn't necessary anymore.

I ran the code without .mark_used() in those three lines. It still seems to be working.