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

New method to set shape of model inputs #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fuzhenxin
Copy link

@fuzhenxin fuzhenxin commented Jun 28, 2020

For tensorflow>=2.2.0, the model._set_inputs failed in

model._set_inputs(input_spec, training=False)
, and the model.inputs and model.outpus are all None.
The following error will happen when running in Android:
java.lang.IllegalStateException: Internal error: Unexpected failure when preparing tensor allocations: tensorflow/lite/kernels/kernel_util.cc:249 d1 == d2 || d1 == 1 || d2 == 1 was not true.
For tensorflow<=2.1.0, the error will not happen.

The added code set inputs shape of model by adding an additional layer, and it works for both tensorflow>=2.2 and tensorflow<2.2

@jipson7
Copy link

jipson7 commented Jul 6, 2020

Thank you. Can confirm this is working and necessary in TF >=2.2

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

Successfully merging this pull request may close these issues.

2 participants