gpt4 book ai didi

android - java.lang.IllegalArgumentException : Cannot copy between a TensorFlowLite tensor with shape 异常

转载 作者:行者123 更新时间:2023-11-29 00:53:21 27 4
gpt4 key购买 nike

最近几天我一直在尝试这个。我已经从 here 下载了一个示例.我已经替换了模型 Detect.tflite 和标签文件并使用了我自己的文件,但最终出现了几个错误,如下所示:

java.lang.IllegalArgumentException: Cannot convert between a TensorFlowLite buffer with 1080000 bytes and a ByteBuffer with 270000 bytes.

还有这个:

java.lang.IllegalArgumentException: Cannot copy between a TensorFlowLite tensor with shape [1, 1917, 4] and a Java object with shape [1, 10,4].

请帮忙。

最佳答案

问题是关于模型的输入张量与我们在代码中提到的数组 (Android) 的不匹配。

输入张量的改变起到了作用,模型在这种情况下运行良好。

输入张量形状数组从 python 端更改为 [1, 10,4]。

关于android - java.lang.IllegalArgumentException : Cannot copy between a TensorFlowLite tensor with shape 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57393407/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com