farizrahman4u / seq2seq

Sequence to Sequence Learning with Keras
GNU General Public License v2.0
3.17k stars 845 forks source link

error:name 'K' is not defined #276

Open fsdfsd123 opened 4 years ago

fsdfsd123 commented 4 years ago

afte i use sudo pip install git+https://github.com/farizrahman4u/seq2seq.git,I write import seq2seq in python command line , but i meet this bug:

Using TensorFlow backend. Traceback (most recent call last): File "", line 1, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 668, in _load_unlocked File "", line 638, in _load_backward_compatible File "/Users/shawn/anaconda3/lib/python3.7/site-packages/seq2seq-1.0.0-py3.7.egg/seq2seq/init.py", line 1, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 668, in _load_unlocked File "", line 638, in _load_backward_compatible File "/Users/shawn/anaconda3/lib/python3.7/site-packages/seq2seq-1.0.0-py3.7.egg/seq2seq/cells.py", line 1, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 668, in _load_unlocked File "", line 638, in _load_backward_compatible File "/Users/shawn/anaconda3/lib/python3.7/site-packages/recurrentshop-1.0.0-py3.7.egg/recurrentshop/init.py", line 1, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 668, in _load_unlocked File "", line 638, in _load_backward_compatible File "/Users/shawn/anaconda3/lib/python3.7/site-packages/recurrentshop-1.0.0-py3.7.egg/recurrentshop/engine.py", line 10, in NameError: name 'K' is not defined

How can i solve this? thank u

torjusn commented 4 years ago

Have the same issue, think its because of changes to keras backend.

zhunipingan commented 4 years ago

I meet the same error, do you know the solution now, If have, please share me the answer, thanks!

absognety commented 4 years ago

https://github.com/farizrahman4u/seq2seq/issues/165#issuecomment-365166504

Install seq2seq by doing installations as mentioned in above issue:

  1. recurrentshop
  2. seq2seq

If you face a bug as name K is not defined: Fix this using https://github.com/farizrahman4u/seq2seq/issues/165#issuecomment-583959642