crownpku / Information-Extraction-Chinese

Chinese Named Entity Recognition with IDCNN/biLSTM+CRF, and Relation Extraction with biGRU+2ATT 中文实体识别与关系提取
2.23k stars 814 forks source link

[NER_IDCNN_CRF] Training biLSTM+CRF: 'rnn' not defined问题 #25

Open pipigou opened 6 years ago

pipigou commented 6 years ago

按照README.md介绍的方法执行:

#python3 main.py --train=True --clean=True --model_type=bilstm

出现了以下问题:

Traceback (most recent call last):
  File "main.py", line 228, in <module>
    tf.app.run(main)
  File "D:\Anaconda\envs\keras\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "main.py", line 222, in main
    train()
  File "main.py", line 174, in train
    model = create_model(sess, Model, FLAGS.ckpt_path, load_word2vec, config, id_to_char, logger)
  File "C:\Users\cloudy\Desktop\Information-Extraction-Chinese\NER_IDCNN_CRF\utils.py", line 172, in create_model
    model = Model_class(config)
  File "C:\Users\cloudy\Desktop\Information-Extraction-Chinese\NER_IDCNN_CRF\model.py", line 86, in __init__
    model_outputs = self.biLSTM_layer(model_inputs, self.lstm_dim, self.lengths)
  File "C:\Users\cloudy\Desktop\Information-Extraction-Chinese\NER_IDCNN_CRF\model.py", line 161, in biLSTM_layer
    lstm_cell[direction] = rnn.CoupledInputForgetGateLSTMCell(
NameError: name 'rnn' is not defined

查看源码,发现rnn确实没有定义,希望得到您的帮助,谢谢!

crownpku commented 6 years ago

已fix,参考这个commit