# VisionEncoderDecoder/TrOCR

**URL:** <https://discuss.huggingface.co/t/visionencoderdecoder-trocr/10961>\
**Category:** Models\
**Created:** [October 21, 2021, 8:33am UTC](https://discuss.huggingface.co/t/visionencoderdecoder-trocr/10961 "2021-10-21T08:33:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felix92](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/felix92/32/2532_2.png) [@Felix92](https://discuss.huggingface.co/u/Felix92)\
**Post date:** [October 21, 2021, 8:33am UTC](https://discuss.huggingface.co/t/visionencoderdecoder-trocr/10961/1 "2021-10-21T08:33:44Z")

</div>

Hi,  
@nielsr  
I try currently to setup your VisionEncoderDecoderModel with a pretrained bert model as decoder but have some struggle with the model.generate (greedy search) part.

I have setup all i have in a Colab Notebook (else it would be to much for posting directly)  
[Colab Notebook](https://colab.research.google.com/drive/1PZz8oGH3pZEjDpMJex2nZ5p8MiYXzYA8?usp=sharing) (Note: it is open if anyone is interested in collaborating)

Questions:  
What are the difference between decoder\_input\_ids and labels ? (I think decoder\_input\_ids are for training the tokenized labels and labels the complete vocab ids right ?) (I ask in case for the DecoderEncoder model that the tokenized labels are used for both decoder\_input\_ids and labels)

I would like to track the CER / WER metrics in validation step is there another way without model.generate ?

Do you see a way to export this model after training to ONNX format ? I think if this will work i need to implement the greedy search by hand or do you have some solution into the transformers lib currently ?

Thanks a lot 🤗
