paddlehub 引用sklearn 报 cannot load any more object with static TLS 错误

k2fxgqgv  于 4个月前  发布在  其他
关注(0)|答案(1)|浏览(37)

系统环境
paddle.version 2.4.0-rc0

具体代码

!/usr/bin/env python

# -*- coding=utf8 -*-

import os
import sys
import paddlehub as hub
module = hub.Module(name="lac")
test_text = '小明硕士毕业于中国科学院计算所,后在日本京都大学深造'
results = module.lexical_analysis(texts=test_text)

##############

Traceback (most recent call last):
File "/ssd4/liuyaping/python38/lib/python3.8/site-packages/sklearn/__check_build/init.py", line 44, in
from ._check_build import check_build # noqa
ImportError: dlopen: cannot load any more object with static TLS
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test_lac.py", line 5, in
import paddlehub as hub
File "/ssd4/liuyaping/python38/lib/python3.8/site-packages/paddlehub/init.py", line 31, in
from paddlehub import datasets
File "/ssd4/liuyaping/python38/lib/python3.8/site-packages/paddlehub/datasets/init.py", line 16, in
from paddlehub.datasets.chnsenticorp import ChnSentiCorp
File "/ssd4/liuyaping/python38/lib/python3.8/site-packages/paddlehub/datasets/chnsenticorp.py", line 19, in
from paddlehub.datasets.base_nlp_dataset import TextClassificationDataset
File "/ssd4/liuyaping/python38/lib/python3.8/site-packages/paddlehub/datasets/base_nlp_dataset.py", line 21, in
import paddlenlp
File "/ssd4/liuyaping/python38/lib/python3.8/site-packages/paddlenlp/init.py", line 29, in
from . import metrics
File "/ssd4/liuyaping/python38/lib/python3.8/site-packages/paddlenlp/metrics/init.py", line 16, in
from .chunk import ChunkEvaluator
File "/ssd4/liuyaping/python38/lib/python3.8/site-packages/paddlenlp/metrics/chunk.py", line 6, in
from seqeval.metrics.sequence_labeling import get_entities
File "/ssd4/liuyaping/python38/lib/python3.8/site-packages/seqeval/metrics/init.py", line 1, in
from seqeval.metrics.sequence_labeling import (accuracy_score,
File "/ssd4

ma8fv8wu

ma8fv8wu1#

可能是你环境的问题,要不你用anaconda创建一个python3.7的环境安装paddlehub重新试试。另外
results = module.lexical_analysis(texts=[test_text])

相关问题