yongzhuo / Keras-TextClassification

中文长文本分类、短句子分类、多标签分类、两句子相似度(Chinese Text Classification of Keras NLP, multi-label classify, or sentence classify, long or short),字词句向量嵌入层(embeddings)和网络层(graph)构建基类,FastText,TextCNN,CharCNN,TextRNN, RCNN, DCNN, DPCNN, VDCNN, CRNN, Bert, Xlnet, Albert, Attention, DeepMoji, HAN, 胶囊网络-CapsuleNet, Transformer-encode, Seq2seq, SWEM, LEAM, TextGCN

Home Page:https://blog.csdn.net/rensihui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问想在HAN模型中使用XLNET作为embedding_type出现这个问题怎么解决?

ZzzD97 opened this issue · comments

WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\ops\resource_variable_ops.py:1630: calling BaseResourceVariable.init (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Traceback (most recent call last):
File "E:/gihub/wangchong1119-Keras-TextClassification-master/Keras-TextClassification/keras_textclassification/m12_HAN/train.py", line 99, in
train(rate=1) # sample条件下设为1,否则训练语料可能会很少
File "E:/gihub/wangchong1119-Keras-TextClassification-master/Keras-TextClassification/keras_textclassification/m12_HAN/train.py", line 80, in train
graph = Graph(hyper_parameters)
File "E:\gihub\wangchong1119-Keras-TextClassification-master\Keras-TextClassification\keras_textclassification\m12_HAN\graph.py", line 29, in init
super().init(hyper_parameters)
File "E:\gihub\wangchong1119-Keras-TextClassification-master\Keras-TextClassification\keras_textclassification\base\graph.py", line 57, in init
249
self.create_model(hyper_parameters)
File "E:\gihub\wangchong1119-Keras-TextClassification-master\Keras-TextClassification\keras_textclassification\m12_HAN\graph.py", line 37, in create_model
super().create_model(hyper_parameters)
File "E:\gihub\wangchong1119-Keras-TextClassification-master\Keras-TextClassification\keras_textclassification\base\graph.py", line 81, in create_model
self.word_embedding = Embeddings(hyper_parameters=hyper_parameters)
File "E:\gihub\wangchong1119-Keras-TextClassification-master\Keras-TextClassification\keras_textclassification\base\embedding.py", line 269, in init
super().init(hyper_parameters)
File "E:\gihub\wangchong1119-Keras-TextClassification-master\Keras-TextClassification\keras_textclassification\base\embedding.py", line 63, in init
self.build()
File "E:\gihub\wangchong1119-Keras-TextClassification-master\Keras-TextClassification\keras_textclassification\base\embedding.py", line 315, in build
encoder_layer = model.get_layer(index=layer_dict[self.layer_indexes[0]]).output
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\base_layer.py", line 845, in output
' has multiple inbound nodes, '
AttributeError: Layer Attention-Normal-12 has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use get_output_at(node_index) instead.

keras版本不对