question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttentionModel problem

See original GitHub issue

./main.py --config=configs/example_cornell.yml Setting up Cornell dataset. Creating DynamicBot . . . Traceback (most recent call last): File "./main.py", line 148, in <module> tf.app.run() File "/home/paz/DEEPCHATMODELTEST/deepchatenv/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "./main.py", line 139, in main bot = bot_class(dataset, config) File "/home/paz/DEEPCHATMODELTEST/DeepChatModels/chatbot/dynamic_models.py", line 46, in __init__ self.build_computation_graph(dataset) File "/home/paz/DEEPCHATMODELTEST/DeepChatModels/chatbot/dynamic_models.py", line 133, in build_computation_graph loop_embedder=self.embedder) File "/home/paz/DEEPCHATMODELTEST/DeepChatModels/chatbot/components/decoders.py", line 317, in __call__ cell = self.get_cell('attn_cell', initial_state) File "/home/paz/DEEPCHATMODELTEST/DeepChatModels/chatbot/components/decoders.py", line 332, in get_cell initial_cell_state=initial_state) File "/home/paz/DEEPCHATMODELTEST/DeepChatModels/chatbot/components/base/_rnn.py", line 186, in __init__ super(SimpleAttentionWrapper, self).__init__(name=name) TypeError: object.__init__() takes no parameters After fixing that error manually in the code another thing pops out.

Traceback (most recent call last): File "./main.py", line 148, in <module> tf.app.run() File "/home/paz/DEEPCHATMODELTEST/deepchatenv/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "./main.py", line 139, in main bot = bot_class(dataset, config) File "/home/paz/DEEPCHATMODELTEST/DeepChatModels/chatbot/dynamic_models.py", line 46, in __init__ self.build_computation_graph(dataset) File "/home/paz/DEEPCHATMODELTEST/DeepChatModels/chatbot/dynamic_models.py", line 133, in build_computation_graph loop_embedder=self.embedder) File "/home/paz/DEEPCHATMODELTEST/DeepChatModels/chatbot/components/decoders.py", line 317, in __call__ cell = self.get_cell('attn_cell', initial_state) File "/home/paz/DEEPCHATMODELTEST/DeepChatModels/chatbot/components/decoders.py", line 332, in get_cell initial_cell_state=initial_state) File "/home/paz/DEEPCHATMODELTEST/DeepChatModels/chatbot/components/base/_rnn.py", line 215, in __init__ self._attention_mechanism.batch_size, AttributeError: 'LuongAttention' object has no attribute 'batch_size' I looked into source code of tensorflow and found that attribute batch_size is introduced in version 1.2. Long story short, could you please write what configuration of tensorflow and dependencies are you using for training models with attention?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mckinziebrandoncommented, Jun 19, 2017

@pazocode Finally got around to looking at this. I pushed what works for me in the branch tf1.2-fixes-issue-6. Does this work for you? I also updated the requirements.txt file in that branch to be the exact TensorFlow version I used to test it.

Edit: Forgot to mention the TF version I was using before. I regularly rebuild from source so I was hesitant to mention it. I’ve primarily been working in one of the 1.1 version release branches, but I don’t have the exact commit hash handy. I’ve now updated to a “stable” version of 1.2 to avoid any further oddities like this. (Minor release updates are not supposed to break libraries like this)

0reactions
pazocodecommented, Jun 12, 2017

I overcome problems with modification of your code and switching to tf1.2 but I need to test correctness of these changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is attention mechanism?
Models with different sequences lengths are, for example, sentiment analysis that receives a sequence of words and outputs a number, or Image ...
Read more >
Attention Models Definition
Attention models break down complicated tasks into smaller areas of attention that are processed sequentially.
Read more >
Attention Mechanism In Deep Learning
A complete guide to attention models and attention mechanisms in deep learning. Learn how to implement an attention model in python using ...
Read more >
How Attention works in Deep Learning: understanding the ...
The attention mechanism emerged naturally from problems that deal with time-varying data (sequences). So, since we are dealing with ...
Read more >
Attention Models: What They Are and Why They Matter - Blog
In machine learning, “attention” refers to assigning relevance and importance to specific parts of the input data while ignoring the rest to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found