简体   繁体   English

为什么我得到 Highway.forward:运行时必须存在“输入”:从 elmoformanylangs 导入嵌入器

[英]Why i getting Highway.forward: `input` must be present when running : from elmoformanylangs import Embedder

I am trying to use ELMoForManyLangs programmatically, by using Embedder python object.我正在尝试通过使用 Embedder python object 以编程方式使用 ELMoForManyLangs。

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

When I run, I am getting the following error:当我运行时,我收到以下错误:

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

Do you have any suggestions to fix it?你有什么建议来解决它吗?

I had the same issue.我遇到过同样的问题。 It seems to be a problem related to overrides package.这似乎是与覆盖 package 相关的问题。 I solve downgrading the 'overrides' package in my virtual-env.我解决了在我的虚拟环境中降级“覆盖”package 的问题。 In particular I switched from overrides==6.0.1 to overrides==3.1.0.特别是我从 overrides==6.0.1 切换到 overrides==3.1.0。

So you should try to do:所以你应该尝试这样做:

pip uninstall overrides
pip install overrides==3.1.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ELMo嵌入中的“Highway.forward:输入必须存在”? - `Highway.forward: input must be present` in ELMo embedding? 为什么我从 input() 中得到“NameError”? - Why am I getting "NameError" from input()? 尝试在终端中导入 docx 时为什么会收到此 ImportError? - Why am I getting this ImportError when trying to import docx in the Terminal? 为什么我需要在 Heroku 中进行相对导入,但在本地运行时不需要? - Why do I need a relative import in Heroku but not when running locally? 尝试导入JSON时为什么会收到IntegrityError? - Why am I getting an IntegrityError when attempting to import JSON? 运行Locust时为什么会出现403错误? - Why am I getting a 403 error when running Locust? 为什么在运行 python 可执行文件时出现此错误? - Why am i getting this error when running a python executable? 为什么我在运行此脚本时收到 tensorflow 警告? - why am i getting a tensorflow warning when running this script? 为什么程序未运行时访问被拒绝? - Why am I getting access denied when program is not running? 为什么 pipfile 中存在的模块在尝试导入时会给出未解析的引用 - Why a module present in pipfile gives unresolved reference when tried to import
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM