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

NotImplementedError raised when predicting on batches #4

Open
karths8 opened this issue Aug 26, 2020 · 0 comments
Open

NotImplementedError raised when predicting on batches #4

karths8 opened this issue Aug 26, 2020 · 0 comments

Comments

@karths8
Copy link

karths8 commented Aug 26, 2020

I want to predict on single sentences using the multinlp pretrained model on SRL using this command

allennlp predict model.tar.gz ner-examples.jsonl --include-package brat_multitask --cuda-device 0 --predictor brat --weights-file best.th --output-file out.json

Unfortunately, I receive a NotImplementedError raised as follows:

Traceback (most recent call last):
  File "/home/karthik/anaconda3/envs/spanrel/bin/allennlp", line 8, in <module>
    sys.exit(run())
  File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/run.py", line 18, in run
    main(prog="allennlp")
  File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/__init__.py", line 102, in main
    args.func(args)
  File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/predict.py", line 204, in _predict
    manager.run()
  File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/predict.py", line 183, in run
    for model_input_json, result in zip(batch_json, self._predict_json(batch_json)):
  File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/predict.py", line 129, in _predict_json
    results = [self._predictor.predict_json(batch_data[0])]
  File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/predictors/predictor.py", line 57, in predict_json
    instance = self._json_to_instance(inputs)
  File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/predictors/predictor.py", line 104, in _json_to_instance
    raise NotImplementedError
NotImplementedError

Any fix for this?
(allennlp 0.8.4)

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

1 participant