hankcs / HanLP

中文分词 词性标注 命名实体识别 依存句法分析 成分句法分析 语义依存分析 语义角色标注 指代消解 风格转换 语义相似度 新词发现 关键词短语提取 自动摘要 文本分类聚类 拼音简繁转换 自然语言处理
https://hanlp.hankcs.com/
Apache License 2.0
33.97k stars 10.18k forks source link

a bug #1839

Closed luffy-fight closed 1 year ago

luffy-fight commented 1 year ago

Describe the bug 运行recongnizer = hanlp.load(hanlp.pretrained.ner.MSRA_NER_ALBERT_BASE_ZH)时报错

Failed to load https://file.hankcs.com/hanlp/ner/msra_ner_albert_base_20211228_173323.zip If the problem still persists, please submit an issue to https://github.com/hankcs/HanLP/issues When reporting an issue, make sure to paste the FULL ERROR LOG below. ================================ERROR LOG BEGINS================================ OS: Windows-10-10.0.22621-SP0 Python: 3.9.13 PyTorch: 2.0.1+cu118 TensorFlow: 2.13.0 HanLP: 2.1.0-beta.50

RuntimeError: Failed to import transformers.models.albert.modeling_tf_albert because of the following error (look up to see its traceback): No module named 'keras.engine'

Code to reproduce the issue import hanlp recongnizer = hanlp.load(hanlp.pretrained.ner.MSRA_NER_ALBERT_BASE_ZH)

Describe the current behavior 已经成功下载了模型,但是在加载的时候报错 hanlp版本为2.1.0b50

Expected behavior 希望能够将下载的模型加载进来使得代码能够成功运行

System information ================================ERROR LOG BEGINS================================ OS: Windows-10-10.0.22621-SP0 Python: 3.9.13 PyTorch: 2.0.1+cu118 TensorFlow: 2.13.0 HanLP: 2.1.0-beta.50

Other info / logs 源代码: import hanlp recongnizer = hanlp.load(hanlp.pretrained.ner.MSRA_NER_ALBERT_BASE_ZH)

hankcs commented 1 year ago

dup: https://github.com/huggingface/transformers/issues/23352#issuecomment-1559699535