Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/344.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TypeError:Python3中不可能提供类建议。改用@implementer类装饰器_Python_Huggingface Transformers - Fatal编程技术网

TypeError:Python3中不可能提供类建议。改用@implementer类装饰器

TypeError:Python3中不可能提供类建议。改用@implementer类装饰器,python,huggingface-transformers,Python,Huggingface Transformers,我正试图用 安装变压器 但它给了我这个错误。 我试着安装NVIDIA的Apex,但它在Mac上不起作用 附言:我想在mac上安装变形金刚(不支持gpu) 我还安装了NVIDIA的apex 错误 TypeError回溯(最近一次调用) 在里面 ---->1进口变压器 /中的Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/transformers/__-init___;.py 21 22#配置

我正试图用

安装变压器

但它给了我这个错误。 我试着安装NVIDIA的Apex,但它在Mac上不起作用

附言:我想在mac上安装变形金刚(不支持gpu)

我还安装了NVIDIA的apex

错误

TypeError回溯(最近一次调用)
在里面
---->1进口变压器
/中的Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/transformers/__-init___;.py
21
22#配置
--->23从.configuration\u albert导入albert\u PRETRAINED\u CONFIG\u ARCHIVE\u MAP,AlbertConfig
24 from.configuration\u auto import ALL\u PRETRAINED\u CONFIG\u ARCHIVE\u MAP、CONFIG\u MAPPING、AutoConfig
25 from.configuration_bart import BartConfig
/中的Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/transformers/configuration_-albert.py
16“ALBERT型号配置”
17
--->18 from.configuration_utils导入PretrainedConfig
19
20
/中的Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/transformers/configuration_utils.py
23从输入import Dict,Tuple
24
--->25 from.file\u utils import CONFIG\u NAME、cached\u path、hf\u bucket\u url是\u remote\u url
26
27
/中的Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/transformers/file_utils.py
101
102尝试:
-->103来自apex进口和noqa:F401
104
105_有_顶点=真
/中的Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site packages/apex/_init__.py
16从apex.exceptions导入(ApexAuthSecret,
17(秘密)
--->18从apex.interfaces导入(apex实施,
19(IApex)
20来自apex.lib.libapex导入(groupfinder,
/中的Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/apex/interfaces.py
8通
9
--->10类APEX实施(对象):
11''类,以便我们可以判断是否从其他
12份申请
/ApexImplementation()中的Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/apex/interfaces.py
12份申请
13     """
--->14个机具(IApex)
/实现(*接口)中的Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zope/interface/declarations.py
704#该街区的覆盖范围:(
705如果蟒蛇3:
-->706 raise TypeError(\u建议\u错误%‘实施者’)
707_实现(“实现”、接口、类实现)
708
TypeError:Python3中不可能提供类建议。请改用@implementer类装饰器。
您已安装;这是Pyramid web框架的一个项目,PyPI的最新版本与Python 3不兼容

你需要卸载那个项目,然后安装正确的项目,小心,这个项目有,涉及创建一个本地的Git存储库克隆,然后编译扩展代码。考虑到这需要一个C++编译器和一个最近的CUDA发布。罗维德斯

要卸载错误的项目,应充分使用(从笔记本中):

pip卸载apex
然后按照提示进行操作。如果尚未重新启动笔记本,则必须重新启动笔记本。您可以在新的Python解释器或重新启动的笔记本中使用
import apex
来验证项目是否已结束。如果
import apex
仍然成功,请使用
print(apex.\uuu文件\uuuuuuu)
查找安装位置,以便您可以手动删除
apex
目录和同一位置的任何
apex-*.dist info
目录

我确实注意到,该项目似乎只支持Linux,在较小程度上支持Windows,并且存在漏洞。我自己没有支持CUDA的Mac(MacBook Pros没有NVIDIA GPU),因此我无法验证这是否仍然是一个问题,尽管我怀疑该漏洞报告不再适用(所讨论的特定组件已经并且已经有过多次更新;自那次错误报告以来已经有了更新)

!pip install transformers
TypeError                                 Traceback (most recent call last)
<ipython-input-1-279c49635b32> in <module>
----> 1 import transformers

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/transformers/__init__.py in <module>
     21 
     22 # Configurations
---> 23 from .configuration_albert import ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, AlbertConfig
     24 from .configuration_auto import ALL_PRETRAINED_CONFIG_ARCHIVE_MAP, CONFIG_MAPPING, AutoConfig
     25 from .configuration_bart import BartConfig

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/transformers/configuration_albert.py in <module>
     16 """ ALBERT model configuration """
     17 
---> 18 from .configuration_utils import PretrainedConfig
     19 
     20 

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/transformers/configuration_utils.py in <module>
     23 from typing import Dict, Tuple
     24 
---> 25 from .file_utils import CONFIG_NAME, cached_path, hf_bucket_url, is_remote_url
     26 
     27 

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/transformers/file_utils.py in <module>
    101 
    102 try:
--> 103     from apex import amp  # noqa: F401
    104 
    105     _has_apex = True

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/apex/__init__.py in <module>
     16 from apex.exceptions import (ApexAuthSecret,
     17                              ApexSessionSecret)
---> 18 from apex.interfaces import (ApexImplementation,
     19                              IApex)
     20 from apex.lib.libapex import (groupfinder,

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/apex/interfaces.py in <module>
      8     pass
      9 
---> 10 class ApexImplementation(object):
     11     """ Class so that we can tell if Apex is installed from other 
     12     applications

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/apex/interfaces.py in ApexImplementation()
     12     applications
     13     """
---> 14     implements(IApex)

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zope/interface/declarations.py in implements(*interfaces)
    704     # the coverage for this block there. :(
    705     if PYTHON3:
--> 706         raise TypeError(_ADVICE_ERROR % 'implementer')
    707     _implements("implements", interfaces, classImplements)
    708 

TypeError: Class advice impossible in Python3.  Use the @implementer class decorator instead.