models icon indicating copy to clipboard operation
models copied to clipboard

Inference for AttentionOCR model

Open neso613 opened this issue 4 years ago • 11 comments

Hi there! I am trying to understand Attention OCR repo and its inference. I have seen its input/output details - image

it says, it takes (32) as string. I don't get this. What does it mean? In demo_inference.py, there is run method-

def run(checkpoint, batch_size, dataset_name, image_path_pattern): images_placeholder, endpoints = create_model(batch_size,dataset_name) images_data = load_images(image_path_pattern, batch_size,dataset_name) session_creator = monitored_session.ChiefSessionCreator(checkpoint_filename_with_path=checkpoint) with monitored_session.MonitoredSession(session_creator=session_creator) as sess: predictions = sess.run(endpoints.predicted_text,feed_dict={images_placeholder: images_data}) return [pr_bytes.decode('utf-8') for pr_bytes in predictions.tolist()]

Here, it takes images_data which -- image as batch_size is 1.

Please help me to know this better. @leandroschelb

neso613 avatar Oct 04 '21 11:10 neso613

Hi @kumariko Any idea for this isuue?

neso613 avatar Oct 05 '21 06:10 neso613

@kumariko This model trained on TF1.x version. Still model can be exported to saved format. Can we use TF2.x for model and training. Pls reply.

neso613 avatar Oct 07 '21 08:10 neso613

pls update on this.

neso613 avatar Oct 15 '21 12:10 neso613

@kumariko This model trained on TF1.x version. Still model can be exported to saved format. Can we use TF2.x for model and training. Pls reply.

You should be able to use TF2.x for training and inference

kyscg avatar Oct 17 '21 13:10 kyscg

@kumariko This model trained on TF1.x version. Still model can be exported to saved format. Can we use TF2.x for model and training. Pls reply.

You should be able to use TF2.x for training and inference

Same issue with TF2.x inferencing. Input details are not clear

neso613 avatar Jan 12 '22 17:01 neso613

@neso613 Could you please try with TF v2.8.0 and let us know if it is still an issue ? Thanks!

sushreebarsa avatar Mar 07 '22 15:03 sushreebarsa

@neso613 Could you please try with TF v2.8.0 and let us know if it is still an issue ? Thanks!

sure , I'll do and keep the forum updated thanks

neso613 avatar Mar 07 '22 17:03 neso613

Hi @sushreebarsa I have upgraded TF version to 2.8 but still no success

image

neso613 avatar Mar 13 '22 09:03 neso613

@neso613 Could you please confirm if you are using the same type of normalization which was used in training? In order to expedite the trouble-shooting process, please provide a code snippet to reproduce the issue reported here. Thank you!

sushreebarsa avatar Dec 15 '22 09:12 sushreebarsa

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.

google-ml-butler[bot] avatar Dec 22 '22 09:12 google-ml-butler[bot]

@neso613 Could you please confirm if you are using the same type of normalization which was used in training? In order to expedite the trouble-shooting process, please provide a code snippet to reproduce the issue reported here. Thank you!

Yes

neso613 avatar Dec 22 '22 10:12 neso613