rsommerfeld / trocr

Powerful handwritten text recognition. A simple-to-use, unofficial implementation of the paper "TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models".

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issue on shape of underlying tensors

Olivier-aka-Raiden opened this issue · comments

Hi, I wanted to give it a try and when trying to do inferance on the base model, I get an error as follows :
IndexError: The shape of the mask [1, 4] at index 0 does not match the shape of the indexed tensor [8, 5] at index 0

I tried with jpg and png image, both have the exact output. Also, using the python example code didn't change anything, error is the same.
Is it because of new tensorflow version ? Can you help me fix the code to make it work ? Probably the definition of the dtype is incorrect.

Hi, have you been able to resolve your problem? If not, can you provide more details? All parts of the repository are still working on a clean setup for me. The repository also relies on pytorch, not tensorflow.