bi-att-flow icon indicating copy to clipboard operation
bi-att-flow copied to clipboard

cannot import name _linear in nn.py

Open ImSuMyatNoe opened this issue 6 years ago • 4 comments

This import error shows up when I try to train.

ImSuMyatNoe avatar Mar 24 '18 02:03 ImSuMyatNoe

from tensorflow.python.ops import rnn_cell_impl
_linear = rnn_cell_impl._linear  # pylint: disable=invalid-name, protected-access

lovecambi avatar Apr 06 '18 22:04 lovecambi

@lovecambi 's solution didn't work for me, however got it to run and created a pull request to the dev branch https://github.com/allenai/bi-att-flow/pull/89

klintan avatar Apr 16 '18 18:04 klintan

@klintan 's solution seems work but need additional tweak. You need make following changes in basic/model.py: tf.concat(0, [word_emb_mat, self.new_emb_mat]) -> tf.concat([word_emb_mat, self.new_emb_mat], 0) Update all other concat functions as well.

jinfengr avatar May 07 '18 19:05 jinfengr

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

shimafoolad avatar Feb 16 '19 21:02 shimafoolad