nlp-models icon indicating copy to clipboard operation
nlp-models copied to clipboard

ConfigurationError

Open cmatosve opened this issue 4 years ago • 5 comments

I am getting errors on the configuration while running the example you provide on the repository. I wonder if there is a broader documentation for the package that I could use? I am using the model you provide on the Readme file: experiments/greetings/copynet.json

`Traceback (most recent call last): File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/common/params.py", line 243, in pop value = self.params.pop(key) KeyError: 'data_loader'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/bin/allennlp", line 33, in sys.exit(load_entry_point('allennlp', 'console_scripts', 'allennlp')()) File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/main.py", line 18, in run main(prog="allennlp") File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/commands/init.py", line 93, in main args.func(args) File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/commands/train.py", line 143, in train_model_from_args dry_run=args.dry_run, File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/commands/train.py", line 202, in train_model_from_file dry_run=dry_run, File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/commands/train.py", line 265, in train_model dry_run=dry_run, File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/commands/train.py", line 452, in _train_worker batch_weight_key=batch_weight_key, File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/common/from_params.py", line 583, in from_params **extras, File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/common/from_params.py", line 611, in from_params kwargs = create_kwargs(constructor_to_inspect, cls, params, **extras) File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/common/from_params.py", line 202, in create_kwargs cls.name, param_name, annotation, param.default, params, **extras File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/common/from_params.py", line 301, in pop_and_construct_arg popped_params = params.pop(name, default) if default != _NO_DEFAULT else params.pop(name) File "/home/claudia/.local/share/virtualenvs/nlp-models-4oWy4XcD/src/allennlp/allennlp/common/params.py", line 245, in pop raise ConfigurationError(f'key "{key}" is required at location "{self.history}"') allennlp.common.checks.ConfigurationError: key "data_loader" is required at location "" ✗ Training job experiments/greetings/copynet.json failed. Total time: 0 hours, 0 minutes and 3 seconds elapsed. `

cmatosve avatar Jun 25 '20 09:06 cmatosve

Hi, I haven't updated this in a while. I'd suggest using the CopyNet implementation from AllenNLP Models. You can find example configs here: https://github.com/allenai/allennlp-models/tree/master/test_fixtures/generation/copynet

epwalsh avatar Jun 26 '20 21:06 epwalsh

Hi,

Thanks so much for the pointer to example config files!! I've been searching for some examples for days! Are there any example scripts for the prediction part? More specifically for copynet? I'm very new to this and I was trying to follow this but it doesn't seem to be working for copynet...could you help me with the necessary changes?

Thanks!

md975 avatar Apr 10 '21 04:04 md975

Hi, what error are you getting when you try that with CopyNet?

epwalsh avatar Apr 12 '21 19:04 epwalsh

Hi,

Thanks for your response. I think the problem was that the predictor here returns a list of list of predicted_tokens...I assume I should just use the tokens from the first one because the list is sorted based on probability...?

md975 avatar Apr 12 '21 19:04 md975

I assume I should just use the tokens from the first one because the list is sorted based on probability...?

That's correct

epwalsh avatar Apr 12 '21 20:04 epwalsh