Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants