allenai / scicite

Repository for NAACL 2019 paper on Citation Intent prediction
Apache License 2.0
115 stars 18 forks source link

allennlp.common.checks.ConfigurationError: 'scaffold_bilstm_attention_classifier is not a registered name for Model' #3

Closed jacklxc closed 5 years ago

jacklxc commented 5 years ago

Hi, I'm new to AllenNLP. I was trying to simply run scicite to predict the provided test.jsonl file using the pre-trained scicite.tar.gz, but got the following error. Can you please help me fixing it?

2019-05-09 23:29:57,079 - INFO - allennlp.models.archival - loading archive file scicite.tar.gz
2019-05-09 23:29:57,080 - INFO - allennlp.models.archival - extracting archive file scicite.tar.gz to temp dir /lfs_ssd/uge-tmpdir/2140811.1.all.q/tmpswccpjxq
Traceback (most recent call last):
  File "/nas/home/xiangcil/anaconda3/envs/allennlp/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/nas/home/xiangcil/anaconda3/envs/allennlp/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/nas/home/xiangcil/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/run.py", line 18, in <module>
    main(prog="allennlp")
  File "/nas/home/xiangcil/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/commands/__init__.py", line 72, in main
    args.func(args)
  File "/nas/home/xiangcil/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/commands/predict.py", line 187, in _predict
    predictor = _get_predictor(args)
  File "/nas/home/xiangcil/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/commands/predict.py", line 99, in _get_predictor
    overrides=args.overrides)
  File "/nas/home/xiangcil/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/models/archival.py", line 156, in load_archive
    cuda_device=cuda_device)
  File "/nas/home/xiangcil/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/models/model.py", line 321, in load
    return cls.by_name(model_type)._load(config, serialization_dir, weights_file, cuda_device)
  File "/nas/home/xiangcil/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/common/registrable.py", line 58, in by_name
    raise ConfigurationError("%s is not a registered name for %s" % (name, cls.__name__))
allennlp.common.checks.ConfigurationError: 'scaffold_bilstm_attention_classifier is not a registered name for Model'
2019-05-09 23:30:07,506 - INFO - allennlp.models.archival - removing temporary unarchived model dir at /lfs_ssd/uge-tmpdir/2140811.1.all.q/tmpswccpjxq
jacklxc commented 5 years ago

It seems that this is because I didn't add the line --include-package scicite.

Kouuh commented 3 years ago

Can you show me the command line you executed? I get an error when I use my own command line. My command line looks like the following: allennlp predict aclarc.tar.gz aclarcdata/test.jsonl --predictor predictor_aclarc --include-package scicite --overrides "{'model':{'data_format':'predictor_aclarc'}}"