Enny1991 / PLSTM

137 stars 32 forks source link

Error RNNCell is not defined #12

Closed amirgholami closed 7 years ago

amirgholami commented 7 years ago

Hi,

First thanks for converting the original code to TF. I get the following error when running the test script:

python simplePhasedLSTM.py:

Traceback (most recent call last): File "simplePhasedLSTM.py", line 6, in from PhasedLSTMCell import PhasedLSTMCell, multiPLSTM File "/Users/new/plstm/PhasedLSTMCell.py", line 91, in class PhasedLSTMCell(RNNCell): NameError: name 'RNNCell' is not defined

I am using tf 1.2.1 and python 2.7.13

Enny1991 commented 7 years ago

Hi @amirgholami

Since you are using tf 1.2 I believe you need to use simplePhasedLSTM_v1.py. So the one which is written for version 1 and above. Since there was a big change in API from version 0.x to 1.x I needed to create two different scripts for backward compatibility (I guess is not needed anymore though). Let me know if running simplePhasedSLTM_v1.py gives you problems.

Cheers +Enea

amirgholami commented 7 years ago

Hi @Enny1991

Thanks for you reply. With _v1 I also get the following error:

Traceback (most recent call last): File "simplePhasedLSTM_v1.py", line 7, in from PhasedLSTMCell_v1 import PhasedLSTMCell, multiPLSTM File "/Users/new/Research/Berkeley/large_batch/PLSTM/PhasedLSTMCell_v1.py", line 18, in from tensorflow.python.ops.rnn_cell_impl import _RNNCell ImportError: cannot import name _RNNCell

Enny1991 commented 7 years ago

Yep you where right, I forgot to update the import of RNNCell after tensorflow changed (again!!) the API. Should be fixed now.

Thanks, +Enea