Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigurationError #44

Open
cmatosve opened this issue Jun 25, 2020 · 5 comments
Open

ConfigurationError #44

cmatosve opened this issue Jun 25, 2020 · 5 comments

Comments

@cmatosve
Copy link

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.
`

@epwalsh
Copy link
Owner

epwalsh commented Jun 26, 2020

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

@md975
Copy link

md975 commented Apr 10, 2021

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!

@epwalsh
Copy link
Owner

epwalsh commented Apr 12, 2021

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

@md975
Copy link

md975 commented Apr 12, 2021

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...?

@epwalsh
Copy link
Owner

epwalsh commented Apr 12, 2021

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

That's correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants