为什么我得到 Highway.forward:运行时必须存在`input`:from elmoformanylangs import Embedder

问题描述

我正在尝试通过使用 Embedder python 对象以编程方式使用 ELMoForManyLangs。

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

您有什么建议可以解决它吗?

解决方法

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

所以你应该尝试这样做:

pip uninstall overrides
pip install overrides==3.1.0