bojone / bert4keras

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

import build_transformer_model时报错 #495

Open whats0mai0name opened 2 years ago

whats0mai0name commented 2 years ago

大佬您好,我在尝试import build_transformer_model的时候报错了,报错提示‘ModuleNotFoundError: No module named 'keras.api'’,尝试使用pip install keras==2.9.0但是依然报错,请问这种情况应该怎么解决呢?系统的基本信息如下:

基本信息

核心代码

from bert4keras.models import build_transformer_model


### 输出信息
ModuleNotFoundError: No module named 'keras.api'
bojone commented 2 years ago

keras不超过2.3.1,tf不超过2.6,最好用tf 1.15