bojone / bert4keras

keras implement of transformers for humans
https://kexue.fm/archives/6915
Apache License 2.0
5.33k stars 924 forks source link

TypeError: __init__() missing 5 required positional arguments: 'hidden_size', 'num_hidden_layers', 'num_attention_heads', 'intermediate_size', and 'hidden_act' #287

Open yangboz opened 3 years ago

yangboz commented 3 years ago

提问时请尽可能提供如下信息:

基本信息

核心代码

basic_language_model_gpt2_ml.py

输出信息

TypeError: __init__() missing 5 required positional arguments: 'hidden_size', 'num_hidden_layers', 'num_attention_heads', 'intermediate_size', and 'hidden_act'

自我尝试

不管什么问题,请先尝试自行解决,“万般努力”之下仍然无法解决再来提问。此处请贴上你的努力过程。

bojone commented 3 years ago

这个问题。。。难道你的config是空的么?

yangboz commented 3 years ago

有示例参考的config吗?我是直接运行python basic_language_model_gpt2_ml.py

bojone commented 3 years ago

有示例参考的config吗?我是直接运行python basic_language_model_gpt2_ml.py

直接跑是需要一个/root/kg/bert/gpt2_ml/config.json的,你的config.json哪儿来的?