报错ModuleNotFoundError: No module named ‘transformers.modeling_bert‘

报错位置:

from transformers.modeling_bert import BertPredictionHeadTransform, BertAttention, BertIntermediate, BertOutput

解决方案:

报错位置改成:

from transformers.models.bert.modeling_bert import BertPredictionHeadTransform, BertAttention, BertIntermediate, BertOutput

你可能感兴趣的:(bert,人工智能,深度学习)