docvqa
docvqa copied to clipboard
Not able to post process the model output.
I am not able to process the output. Please refer to the error log.
Traceback (most recent call last)
Input In [12], in <cell line: 7>()
23 eval_feature = features[example_index.item()]
24 unique_id = int(eval_feature.unique_id)
---> 26 output = [to_list(output[i]) for output in outputs]
27 print("type: ",output)
28 start_logits, end_logits = output
Input In [12], in <listcomp>(.0)
23 eval_feature = features[example_index.item()]
24 unique_id = int(eval_feature.unique_id)
---> 26 output = [to_list(output[i]) for output in outputs]
27 print("type: ",output)
28 start_logits, end_logits = output
Input In [12], in to_list(tensor)
4 def to_list(tensor):
----> 5 return tensor.detach().cpu().tolist()
AttributeError: 'str' object has no attribute 'detach'
I made 2 modifications in the demo.ipynb script.
output = [to_list(output[i]) for output in outputs.logits]
start_logits, end_logits = output[0]
This modification resolved the issue. But the predicted result was wrong.
what is the contact person name mentioned in letter ?
[CLS]
Hi @Ajithbalakrishnan, I have the same issue. Were you able to generate the correct result?