ValueError: For training, each question should have exactly 1 answer.
Tried to run run_squad.py with the squad 2.0 dataset and came up with this error, ValueError: For training, each question should have exactly 1 answer. How do I solve this?
Please give more information: the command used (arguments passed), traceback (the command line output), and version (can use `pip show pytorch_pretrained_bert`)

I faced a similar problem with `read_squad_examples` when passing `input_file=dev.json` and `is_training=True`. <|||||>I have this problem when training on SQUADv2 without `--version_2_with_negative` option. Basically for squad 2.0, it is possible there is no answer for questions. Adding this option in training command fixed the problem for me.<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
<|||||>Hi,

I see the same error. Some of the questions have multiple answer spans. 

The error suggests that the current preprocessing codes cannot handle multiple answer spans for a given question.

 Has anyone fixed this ??

Thanks<|||||>I also receive this error when using the `--version_2_with_negative` flag paired with training data from SQuAD 2.0. It looks like it may be caused by some logic in `utils_squad.py`, lines 150-152; it seems that answerable questions are expected to only have one answer. I'm not familiar enough with the task and data set to know if this is a correct assumption, but since I'm using data from the SQuAD 2.0 web site I would think it should train fine.<|||||>For training, the assumption is true.

On Mon, Nov 18, 2019 at 09:56 Allen Kim <notifications@github.com> wrote:

> I also receive this error when using the --version_2_with_negative flag
> paired with training data from SQuAD 2.0. It looks like it may be caused by
> some logic in utils_squad.py, lines 150-152; it seems that answerable
> questions are expected to only have one answer. I'm not familiar enough
> with the task and data set to know if this is a correct assumption, but
> since I'm using data from the SQuAD 2.0 web site I would think it should
> train fine.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/transformers/issues/554?email_source=notifications&email_token=AIEAE4GLKEIMFR3BUJQK5VTQUHY4BA5CNFSM4HI7NMRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEI5VNI#issuecomment-554818229>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AIEAE4H7OARRY4INFJTGU6DQUHY4BANCNFSM4HI7NMRA>
> .
>
<|||||>Thanks for clarifying!