Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct indexing of TF Lite inputs or reference by name #226

Open
phildow opened this issue May 25, 2021 · 1 comment
Open

Correct indexing of TF Lite inputs or reference by name #226

phildow opened this issue May 25, 2021 · 1 comment

Comments

@phildow
Copy link
Contributor

phildow commented May 25, 2021

As reported in #225 I'm seeing a number of these errors in a model we're using:

There was a problem writing the data buffer to the tensor, error: Error Domain=org.tensorflow.lite.interpreter Code=1 "Input tensor at index (0) expects data size (8), but got (4)." UserInfo={NSLocalizedDescription=Input tensor at index (0) expects data size (8), but got (4).}

Hypothesis 2: Indices in the JSON are out of order and I'm trying to write float32s to inputs that expected int64s

I take the order of the inputs from the saved_model_cli and have always assumed this is the order they will be in TF Lite as well, but I don't actually know if that's the case or how to check input indices. Would be nice if we could reference these by name.

@phildow
Copy link
Contributor Author

phildow commented May 26, 2021

Ordering is in fact an issue and the order of the inputs does not match the order of the inputs as described by the saved_model_cli.

The simplest solution is just to require the consumer to order correctly, since even just figuring out the names can be a hassle. not sure what tool is available for getting indices in tf lite models though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant