facebookresearch / LAMA

LAnguage Model Analysis
Other
1.36k stars 184 forks source link

Error in running ./download_models.sh #58

Open YukeWang96 opened 1 year ago

YukeWang96 commented 1 year ago

Hi,

When I execute ./download_models.sh, encounter the following problem

lowercase models
OpenAI GPT
BERT BASE LOWERCASED
BERT LARGE LOWERCASED
cased models
Transformer XL
ELMO ORIGINAL 5.5B
ELMO ORIGINAL
BERT BASE CASED
BERT LARGE CASED
Building common vocab
Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex.
Traceback (most recent call last):
  File "lama/vocab_intersection.py", line 7, in <module>
    from lama.modules import build_model_by_name
  File "/data/datasets/yuke/LAMA/lama/modules/__init__.py", line 8, in <module>
    from .elmo_connector import Elmo
  File "/data/datasets/yuke/LAMA/lama/modules/elmo_connector.py", line 10, in <module>
    from allennlp.modules.elmo import _ElmoBiLm #, Elmo as AllenNLP_Elmo
  File "/home/yuke_wang/anaconda3/envs/lama37/lib/python3.7/site-packages/allennlp/modules/__init__.py", line 9, in <module>
    from allennlp.modules.elmo import Elmo
  File "/home/yuke_wang/anaconda3/envs/lama37/lib/python3.7/site-packages/allennlp/modules/elmo.py", line 20, in <module>
    from allennlp.modules.highway import Highway
  File "/home/yuke_wang/anaconda3/envs/lama37/lib/python3.7/site-packages/allennlp/modules/highway.py", line 12, in <module>
    class Highway(torch.nn.Module):
  File "/home/yuke_wang/anaconda3/envs/lama37/lib/python3.7/site-packages/allennlp/modules/highway.py", line 49, in Highway
    def forward(self, inputs: torch.Tensor) -> torch.Tensor:  # pylint: disable=arguments-differ
  File "/home/yuke_wang/anaconda3/envs/lama37/lib/python3.7/site-packages/overrides/overrides.py", line 83, in overrides
    return _overrides(method, check_signature, check_at_runtime)
  File "/home/yuke_wang/anaconda3/envs/lama37/lib/python3.7/site-packages/overrides/overrides.py", line 170, in _overrides
    _validate_method(method, super_class, check_signature)
  File "/home/yuke_wang/anaconda3/envs/lama37/lib/python3.7/site-packages/overrides/overrides.py", line 189, in _validate_method
    ensure_signature_is_compatible(super_method, method, is_static)
  File "/home/yuke_wang/anaconda3/envs/lama37/lib/python3.7/site-packages/overrides/signature.py", line 113, in ensure_signature_is_compatible
    method_name,
  File "/home/yuke_wang/anaconda3/envs/lama37/lib/python3.7/site-packages/overrides/signature.py", line 220, in ensure_all_positional_args_defined_in_sub
    raise TypeError(f"{method_name}: `{super_param.name}` must be present")
TypeError: Highway.forward: `input` must be present

Is there any solution to this? Thanks!

pardeep889 commented 1 year ago

The traceback indicates that there's an issue related to the usage of the Highway module from the allennlp library. The error message "Highway.forward: input must be present" suggests that there's a missing input argument when calling the forward method of the Highway module.

Without more context and details about the specific code and its purpose, it's a bit challenging to provide a specific solution. However, the error indicates that you need to ensure that the required input argument is provided when calling the forward method of the Highway module. Double-check the code where this module is being used and make sure that all necessary input parameters are correctly provided.

RafoSoc commented 1 year ago

Hi, I managed to solve this problem by commenting out lines 8 and 21 of the init.py file which is in the modules directory, shown in the figure below.

Screenshot_20231114_124716

LeeSomm commented 4 months ago

An alternative method is to deprecate the installation of overrides. pip uninstall overrides pip install overrides==3.1.0