BERT-BiLSTM-CRF-NER
BERT-BiLSTM-CRF-NER copied to clipboard
crf_only设置为false后
训练完成了,但是测试的时候报错
InvalidArgumentError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
Assign requires shapes of both tensors to match. lhs shape= [769,4] rhs shape= [896,512]
测试的时候,麻烦也使用false.不然肯定会报错的。
测试的时候,麻烦也使用false.不然肯定会报错的。
我也遇到同样的问题,训练推理都是crf_only=false的时候就报这个错。。。 是哪里出问题了?
@macanv 将crf_only设置为fasle后,修改lstm num_layer=2,训练报错,维数不匹配。 Bug?
terminal_predict.py里面的create_model 传参有问题,lstm_size, cell, num_layers 训练时使用的是default值,跟函数里面默认的不一样,在create_model 函数加上(lstm_size=args.lstm_size, cell=args.cell, num_layers=args.num_layers) 就可以成功运行拉~