hankcs / HanLP

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

================================ERROR LOG BEGINS================================ #1864

Closed zsxbcc closed 11 months ago

zsxbcc commented 11 months ago

2023-12-17 19:59:57.877358: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0. Failed to load https://file.hankcs.com/hanlp/mtl/close_tok_pos_ner_srl_dep_sdp_con_electra_small_20210111_124159.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.11.5 PyTorch: 2.1.0 HanLP: 2.1.0-beta.54 Traceback (most recent call last): File "D:\AI\myAI\测试.py", line 6, in HanLP = hanlp.load(hanlp.pretrained.mtl.CLOSE_TOK_POS_NER_SRL_DEP_SDP_CON_ELECTRA_SMALL_ZH) # 中文 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Anaconda\envs\tts\Lib\site-packages\hanlp__init.py", line 43, in load return load_from_meta_file(save_dir, 'meta.json', verbose=verbose, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Anaconda\envs\tts\Lib\site-packages\hanlp\utils\component_util.py", line 186, in load_from_meta_file raise e from None File "D:\Anaconda\envs\tts\Lib\site-packages\hanlp\utils\component_util.py", line 99, in load_from_meta_file obj: Component = object_from_classpath(cls) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Anaconda\envs\tts\Lib\site-packages\hanlp_common\reflection.py", line 27, in object_from_classpath classpath = str_to_type(classpath) ^^^^^^^^^^^^^^^^^^^^^^ File "D:\Anaconda\envs\tts\Lib\site-packages\hanlp_common\reflection.py", line 44, in str_to_type cls = getattr(importlib.import_module(module_name), class_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Anaconda\envs\tts\Lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "D:\Anaconda\envs\tts\Lib\site-packages\hanlp\components\mtl\multi_task_learning.py", line 27, in from hanlp.components.mtl.tasks import Task File "D:\Anaconda\envs\tts\Lib\site-packages\hanlp\components\mtl\tasks__init__.py", line 23, in from hanlp.transform.transformer_tokenizer import TransformerSequenceTokenizer File "D:\Anaconda\envs\tts\Lib\site-packages\hanlp\transform\transformer_tokenizer.py", line 9, in from hanlp.layers.transformers.ptimports import PreTrainedTokenizer, PretrainedConfig, AutoTokenizer File "D:\Anaconda\envs\tts\Lib\site-packages\hanlp\layers\transformers\pt_imports.py", line 11, in from transformers import BertTokenizer, BertConfig, PretrainedConfig, AutoConfig, AutoTokenizer, PreTrainedTokenizer, \ File "", line 1229, in _handle_fromlist File "D:\Anaconda\envs\tts\Lib\site-packages\transformers\utils\import_utils.py", line 1175, in getattr__ value = getattr(module, name) ^^^^^^^^^^^^^^^^^^^^^ File "D:\Anaconda\envs\tts\Lib\site-packages\transformers\utils\import_utils.py", line 1174, in getattr module = self._get_module(self._class_to_module[name]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Anaconda\envs\tts\Lib\site-packages\transformers\utils\import_utils.py", line 1186, in _get_module raise RuntimeError( RuntimeError: Failed to import transformers.models.bert.modeling_bert because of the following error (look up to see its traceback): Failed to import transformers.generation.utils because of the following error (look up to see its traceback): cannot import name 'formatargspec' from 'inspect' (D:\Anaconda\envs\tts\Lib\inspect.py) =================================ERROR LOG ENDS=================================

hankcs commented 11 months ago
  1. py3.11 is not in our supported versions:https://github.com/hankcs/HanLP/blob/0450298721f095c859fd88b7444874c0e81f47be/setup.py#L57
  2. see also https://github.com/GrahamDumpleton/wrapt/issues/196