tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

Errors in tflite_model.ts for text classification tasks

Open sandzone opened this issue 3 years ago • 1 comments

Bug 1: Line 200 const modelInputShape = modelInput.shape.split(',').map(dim => Number(dim));

modelInput.shape is a string with ',' as a separator for thousands. For tflite text classification models using 'average_word_vec',

modelInput.shape is "1,256" modelInputShape is [1,256]

This results in "Input tensor shape mismatch error"

Bug 2: Line 251 This is probably an issue/bug with the way text classification models are getting created with tflite model maker

tflite text classification models have their modelInput.shape property set to "1,256". However, that doesn't seem to be correct as the modelInputBuffer getting calculated at line 251 is only 256.

sandzone avatar Aug 03 '22 15:08 sandzone

In order to expedite the trouble-shooting process, please provide a code snippet to reproduce the issue reported here. Thanks!

rthadur avatar Aug 03 '22 21:08 rthadur

Closing as stale. Please @mention us if this needs more attention.

google-ml-butler[bot] avatar Aug 31 '22 22:08 google-ml-butler[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Aug 31 '22 22:08 google-ml-butler[bot]