如何在Android上部署keras预训练模型

时间:2020-10-31 08:59:32

标签: python android tensor tf-lite

我正在一个项目中,我已经使用keras训练了一个神经网络,现在我的下一个目标是在android上使用该模型,我已经尝试了Internet上的很多参考资料,但对我没有用。

在这里,我将附上我的模型python代码的图片以及收到的错误this is the error I received on android while deploying the model

this is code for neural network, which I have to deploy on android

神经网络具有3个浮点型输入,输出也是浮点型。 我尝试了tflite的多个输入和输出方法,但显示此错误。

错误是:

java.lang.IllegalArgumentException: Internal error: Failed to resize 0-th input: Attempting to resize a fixed-size tensor.

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

如果您是Android新手,请在tensorflow-lite上免费学习此课程

https://www.udacity.com/course/intro-to-tensorflow-lite--ud190

这将为您介绍在Android上的部署

在android代码中,您可以尝试发送float而不是float []

相关问题