Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
552 views
in Technique[技术] by (71.8m points)

tensorflow - how to define interpret inisializer BiLSTM-CRF

I'm implementing the NER code using BiLSTM-CRF. I took the program code from https://github.com/scionoftech/NamedEntityRecognition-BiLSTM-CRF-BERT/blob/master/ner_BiLSTM_CRF.ipynb

when running the model definition there was an error on the line crf = CRF (n_tags + 1) # CRF layer, n_tags + 1 (PAD), with the error message "ValueError: Could not interpret initializer identifier: 18"

I try to resolve it by defining the kernel initialization like def init_f(shape, dtype=None), but it doesn't work properly.

The code imports the tf2crf module from https://pypi.org/project/tf2crf/, wherein the explanation there is a tip if tensorflow> = 2.1.0 Recommend using the latest TensorFlow-addons which is compatible with your tf version. While TensorFlow that I use version 2.4.1. Is there any version of TensorFlow or add-ons used? How to solve this problem?

question from:https://stackoverflow.com/questions/66060762/how-to-define-interpret-inisializer-bilstm-crf

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...