近日,在使用苏神的roformer模型时提示:KeyError: 'roformer错误。详情如下所示
Traceback (most recent call last):
File "G:/roformer-main/train.py", line 129, in <module>
return_keras_model=False
File "C:\Users\zhou\Anaconda3\envs\extract_text\lib\site-packages\bert4keras\models.py", line 2274, in build_transformer_model
MODEL = models[model]
KeyError: 'roformer'
最终发现是因为bert4keras模块的版本不对应,直接在终端输入
pip install bert4keras==0.10.4