allenai / bi-att-flow

Bi-directional Attention Flow (BiDAF) network is a multi-stage hierarchical process that represents context at different levels of granularity and uses a bi-directional attention flow mechanism to achieve a query-aware context representation without early summarization.
http://allenai.github.io/bi-att-flow
Apache License 2.0
1.54k stars 679 forks source link

ImportError: cannot import name 'bidirectional_rnn' #81

Open srijanraj opened 6 years ago

srijanraj commented 6 years ago

File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/srijanr/fyp17/Question-Answering/Allanai-fyp/bi-att-flow/basic/cli.py", line 5, in from basic.main import main as m File "/Users/srijanr/fyp17/Question-Answering/Allanai-fyp/bi-att-flow/basic/main.py", line 14, in from basic.model import get_multi_gpu_models File "/Users/srijanr/fyp17/Question-Answering/Allanai-fyp/bi-att-flow/basic/model.py", line 11, in from my.tensorflow.rnn import bidirectional_dynamic_rnn File "/Users/srijanr/fyp17/Question-Answering/Allanai-fyp/bi-att-flow/my/tensorflow/rnn.py", line 4, in from tensorflow.python.ops.rnn import bidirectional_rnn as _bidirectional_rnn

What can be the solution for it?

lovecambi commented 6 years ago

Try

from tensorflow.python.ops.rnn import static_bidirectional_rnn as _bidirectional_rnn
shimafoolad commented 5 years ago

You can run this branch for the newer version of tensorflow (all errors have been fixed): https://github.com/Vimos/bi-att-flow/tree/tf1.8