为什么我要获取Highway.forward:`input`在运行时必须存在:从ElmofOrmanylags导入嵌入程序

2024-06-28 20:05:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图通过使用Embedder python对象,以编程方式使用ElmoForMyLangs

from elmoformanylangs import Embedder
e = Embedder('/content/drive/MyDrive/ColabNotebooks/158', batch_size = 64)

运行时,出现以下错误:

TypeError                                 Traceback (most recent call last)

<ipython-input-11-e628da2114ae> in <module>()
----> 1 from elmoformanylangs import Embedder
      2 # e = Embedder('/content/drive/MyDrive/ColabNotebooks/158', batch_size = 64)

10 frames

/usr/local/lib/python3.7/dist-packages/overrides/signature.py in ensure_all_positional_args_defined_in_sub(super_sig, sub_sig, super_type_hints, sub_type_hints, check_first_parameter, method_name)
    193         if super_param.kind == Parameter.VAR_POSITIONAL:
    194             if not sub_has_var_args:
--> 195                 raise TypeError(f"{method_name}: `{super_param.name}` must be present")
    196             continue
    197         if (

TypeError: Highway.forward: `input` must be present

你有什么建议来解决它吗


Tags: nameinfromimportsizeifbatchdrive
1条回答
网友
1楼 · 发布于 2024-06-28 20:05:33

我也有同样的问题。这似乎是一个与覆盖包相关的问题。 我解决了在虚拟环境中降级“覆盖”包的问题。特别是,我从覆盖==6.0.1切换到覆盖==3.1.0

因此,您应该尝试:

pip uninstall overrides
pip install overrides==3.1.0

相关问题 更多 >