emnlp2017-bilstm-cnn-crf icon indicating copy to clipboard operation
emnlp2017-bilstm-cnn-crf copied to clipboard

Non GPU tensorflow compatible version

Open fussili opened this issue 6 years ago • 1 comments

Thanks for making this implementation available! But i do not have access to a GPU. Can I still try your code? I have tensorflow 1.5.0 and Keras 2.0.2 I made a couple of changes in neural nets/BiLSTM.py line 296 and 285 Set mask_zero=False and used Concatenate as Merge is not supported Please let me know additional changes do I need to make to use the code in my usecase? I am getting the following error when I try to use the code:

File "Train_NER_E2ESL.py", line 85, in <module>
    model.evaluate(50)
  File "/data/venv/BILSTM_CNN_CRF_TEST/neuralnets/BiLSTM.py", line 394, in evaluate
    self.trainModel()
  File "/data/venv/BILSTM_CNN_CRF_TEST/neuralnets/BiLSTM.py", line 93, in trainModel
    self.buildModel()
  File "/data/venv/BILSTM_CNN_CRF_TEST/neuralnets/BiLSTM.py", line 362, in buildModel
    model.summary()
  File "/data/venv/lib/python3.5/site-packages/keras/engine/network.py", line 1263, in summary
    'This model has never been called, this its weights '
ValueError: This model has never been called, this its weights have not yet been created, so no summary can be displayed. Build the model first (e.g. by calling it on some test data). 
it is not getting saved 
the training is happening but model isnt saved and hence testing isnt done 

Thanks in advance!

fussili avatar Jul 10 '18 11:07 fussili

Hi @fussili A GPU is not required. I run all my experiments of this framework on a CPU.

I highly recommend to use Keras 2.2.0 and Tensorflow 1.7.0 or 1.8.0. I cannot guarantee that it works with any other version of Keras or Tensorflow.

I recommend to either use conda (e.g. miniconda) or to use docker (see the docker/ folder) to ensure that all packages math.

Then, you should be able to run it without any modifications on a CPU.

nreimers avatar Jul 10 '18 11:07 nreimers