Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么用BERTBILSTMCRF模型时报错 #17

Open
sunlisum opened this issue Dec 27, 2023 · 1 comment
Open

为什么用BERTBILSTMCRF模型时报错 #17

sunlisum opened this issue Dec 27, 2023 · 1 comment

Comments

@sunlisum
Copy link

Traceback (most recent call last):
File "train.py", line 101, in
info_list = train_sample(train_model=model, epochs=10, log=log)
File "train.py", line 51, in train_sample
model = model_class.creat_model()
File "/root/NER_DEMO-master/Model/BERT_BILSTM_CRF.py", line 39, in creat_model
trainable=True)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/keras_bert/loader.py", line 169, in load_trained_model_from_checkpoint
**kwargs)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/keras_bert/loader.py", line 58, in build_model_from_config
**kwargs)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/keras_bert/bert.py", line 91, in get_model
dropout_rate=dropout_rate,
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/keras_bert/layers/embedding.py", line 56, in get_embedding
)(embed_layer)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 663, in call
inputs, outputs, args, kwargs)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1708, in set_connectivity_metadata
input_tensors=inputs, output_tensors=outputs, arguments=kwargs)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1796, in _add_inbound_node
input_tensors)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 515, in map_structure
structure[0], [func(*x) for x in entries],
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 515, in
structure[0], [func(*x) for x in entries],
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1795, in
inbound_layers = nest.map_structure(lambda t: t._keras_history.layer,
AttributeError: 'tuple' object has no attribute 'layer'

@yinjihu
Copy link

yinjihu commented Aug 7, 2024

解决了吗? 大佬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants