• overrides报错:TypeError: Highway.forward: `input` must be present


    代码from allennlp.modules import TimeDistributed 报错了:
    /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

    参考这里的解决办法:https://stackoverflow.com/questions/67348569/why-i-getting-highway-forward-input-must-be-present-when-running-from-elmof,更改overrides版本:

    pip install overrides==3.1.0

    输出:

    Collecting overrides==3.1.0
      Downloading https://files.pythonhosted.org/packages/ff/b1/10f69c00947518e6676bbd43e739733048de64b8dd998e9c2d5a71f44c5d/overrides-3.1.0.tar.gz
    Building wheels for collected packages: overrides
      Building wheel for overrides (setup.py) ... done
      Created wheel for overrides: filename=overrides-3.1.0-cp37-none-any.whl size=10174 sha256=296fed9c5e1d4be88c9638f8bd78ad74f6d32d71b5211d0b1040b72e5870d127
      Stored in directory: /home/xyj/.cache/pip/wheels/5c/24/13/6ef8600e6f147c95e595f1289a86a3cc82ed65df57582c65a9
    Successfully built overrides
    Installing collected packages: overrides
      Found existing installation: overrides 6.1.0
        Uninstalling overrides-6.1.0:
          Successfully uninstalled overrides-6.1.0
    Successfully installed overrides-3.1.0

    最终解决了这个报错。

  • 相关阅读:
    hibernate 4 需要导入的jar包
    中国象棋马走日(要求打印每一种走法) — 递归
    最长公共子串
    国际象棋马走日(骑士周游)
    八皇后
    约瑟夫问题
    hashtable的运用实例
    用较小的代价去除字符串中的空格
    C++ string数据类型的实现
    strcpy、strncpy与memcpy的区别与使用方法
  • 原文地址:https://www.cnblogs.com/youmuchen/p/14754781.html
Copyright © 2020-2023  润新知