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

项目model1.py程序报错 #26

Closed
will-wiki opened this issue Nov 19, 2020 · 3 comments
Closed

项目model1.py程序报错 #26

will-wiki opened this issue Nov 19, 2020 · 3 comments

Comments

@will-wiki
Copy link

运行model1.py的时候出现以下错误:
Traceback (most recent call last):
File "/home/liwei/ss/NLP2SQL/tianchi_nl2sql-master/code_nlp/model1.py", line 378, in
bert_model = load_trained_model_from_checkpoint(paths.config, paths.checkpoint, seq_len=None)
File "/home/liwei/ss/NLP2SQL/tianchi_nl2sql-master/keras_bert/loader.py", line 169, in load_trained_model_from_checkpoint
**kwargs)
File "/home/liwei/ss/NLP2SQL/tianchi_nl2sql-master/keras_bert/loader.py", line 58, in build_model_from_config
**kwargs)
File "/home/liwei/ss/NLP2SQL/tianchi_nl2sql-master/keras_bert/bert.py", line 84, in get_model
dropout_rate=dropout_rate,
File "/home/liwei/ss/NLP2SQL/tianchi_nl2sql-master/keras_bert/layers/embedding.py", line 37, in get_embedding
)(inputs[0]),
File "/home/liwei/anaconda3/envs/python360-gpu/lib/python3.6/site-packages/keras/engine/base_layer.py", line 497, in call
arguments=user_kwargs)
File "/home/liwei/anaconda3/envs/python360-gpu/lib/python3.6/site-packages/keras/engine/base_layer.py", line 565, in _add_inbound_node
output_tensors[i]._keras_shape = output_shapes[i]
IndexError: list index out of range

当前环境:
python==3.6.0
keras==2.2.4
tensorflow==1.14

@will-wiki
Copy link
Author

这个问题比较的尴尬,原项目代码采用的keras==2.2.4的代码,引用的keras-bert开源项目已经更新到了2.4.3导致两者不兼容...

@beader
Copy link
Owner

beader commented Nov 23, 2020

可以去 README 最下方查看我当时用到的 docker 镜像

@will-wiki
Copy link
Author

嗯嗯,已经解决了,感谢楼主,是自己操作的问题..

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