Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 转换的tflite文件在颤振中不可用_Flutter_Tensorflow Lite - Fatal编程技术网

Flutter 转换的tflite文件在颤振中不可用

Flutter 转换的tflite文件在颤振中不可用,flutter,tensorflow-lite,Flutter,Tensorflow Lite,我将h5文件转换为tflite。 这个h5文件是一个ml5 Json模型。 我自己刚转换成h5文件。 但它不适用于错误代码 ml5型号链接: Windows10、Python 3.6.8、tfv2.0.0 代码: 我用这些代码转换了文件 这个模型文件被放到我的应用程序中 错误代码: [+14766 ms] D/ViewRootImpl@454dd0a[MainActivity]( 1610): ViewPostIme pointer 0 [ +133 ms] D/ViewRootImpl@454

我将h5文件转换为tflite。 这个h5文件是一个ml5 Json模型。 我自己刚转换成h5文件。 但它不适用于错误代码

ml5型号链接:

Windows10、Python 3.6.8、tfv2.0.0

代码:

我用这些代码转换了文件

这个模型文件被放到我的应用程序中

错误代码:

[+14766 ms] D/ViewRootImpl@454dd0a[MainActivity]( 1610): ViewPostIme pointer 0
[ +133 ms] D/ViewRootImpl@454dd0a[MainActivity]( 1610): ViewPostIme pointer 1
[  +13 ms] I/tflite  ( 1610): Initialized TensorFlow Lite runtime.
[  +36 ms] I/flutter ( 1610): success
[  +12 ms] I/CameraManagerGlobal( 1610): Camera 0 facing CAMERA_FACING_BACK state now
CAMERA_STATE_OPEN for client com.example.examplerealtime API Level 2
[   +9 ms] D/SensorManager( 1610): registerListener :: 1, LSM6DSO Acceleration Sensor,
200000, 0,
[  +86 ms] W/Gralloc3( 1610): allocator 3.x is not supported
[ +573 ms] I/CameraManagerGlobal( 1610): Camera 0 facing CAMERA_FACING_BACK state now
CAMERA_STATE_ACTIVE for client com.example.examplerealtime API Level 2
[  +37 ms] I/CameraManagerGlobal( 1610): Camera 0 facing CAMERA_FACING_BACK state now
CAMERA_STATE_IDLE for client com.example.examplerealtime API Level 2
[ +146 ms] I/Choreographer( 1610): Skipped 44 frames!  The application may be doing too
much work on its main thread.
[ +499 ms] I/CameraManagerGlobal( 1610): Camera 0 facing CAMERA_FACING_BACK state now
CAMERA_STATE_ACTIVE for client com.example.examplerealtime API Level 2
[ +118 ms] D/RenderScript HIDL Adaptation( 1610): IRenderScriptDevice::getService()
[  +11 ms] D/RenderScript HIDL Adaptation( 1610): IRenderScriptDevice::getService()
returned 0x78d5593060
[        ] D/RenderScript HIDL Adaptation( 1610): HIDL successfully loaded.
[   +1 ms] V/RenderScript( 1610): ARM mali (64 bit) RenderScript Compute Driver
[  +40 ms] V/RenderScript( 1610): Successfully loaded runtime: libRSDriverArm.so
[   +1 ms] D/        ( 1610): Successfully queried cache dir:
/data/user_de/0/com.example.examplerealtime/code_cache
[        ] D/RenderScript( 1610): Setting cache dir:
/data/user_de/0/com.example.examplerealtime/code_cache
[  +31 ms] E/MethodChannel#tflite( 1610): Failed to handle method call
[        ] E/MethodChannel#tflite( 1610): java.lang.IllegalArgumentException: Unsupported
value: java.lang.ArrayIndexOutOfBoundsException: length=2; index=3
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:278)
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.plugin.common.StandardMethodCodec.encodeErrorEnvelope(StandardMethodCodec.java
:69)
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.ja
va:236)
[        ] E/MethodChannel#tflite( 1610):       at
sq.flutter.tflite.TflitePlugin.onMethodCall(TflitePlugin.java:113)
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.
java:226)
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:8
5)
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
[        ] E/MethodChannel#tflite( 1610):       at
android.os.MessageQueue.nativePollOnce(Native Method)
[        ] E/MethodChannel#tflite( 1610):       at
android.os.MessageQueue.next(MessageQueue.java:336)
[        ] E/MethodChannel#tflite( 1610):       at android.os.Looper.loop(Looper.java:197
)
[        ] E/MethodChannel#tflite( 1610):       at
android.app.ActivityThread.main(ActivityThread.java:7777)
[        ] E/MethodChannel#tflite( 1610):       at java.lang.reflect.Method.invoke(Native
Method)
[        ] E/MethodChannel#tflite( 1610):       at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
[        ] E/MethodChannel#tflite( 1610):       at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)
[   +4 ms] E/flutter ( 1610): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled
Exception: PlatformException(error, Unsupported value:
java.lang.ArrayIndexOutOfBoundsException: length=2; index=3, null)
[        ] E/flutter ( 1610): #0      StandardMethodCodec.decodeEnvelope
(package:flutter/src/services/message_codecs.dart:569:7)
[        ] E/flutter ( 1610): #1      MethodChannel._invokeMethod
(package:flutter/src/services/platform_channel.dart:156:18)
[        ] E/flutter ( 1610): <asynchronous suspension>
[        ] E/flutter ( 1610): #2      MethodChannel.invokeMethod
(package:flutter/src/services/platform_channel.dart:329:12)
[        ] E/flutter ( 1610): #3      Tflite.runModelOnFrame
(package:tflite/tflite.dart:67:27)
[        ] E/flutter ( 1610): #4      _CameraState.initState.<anonymous
closure>.<anonymous closure> (package:flutter_realtime_detection/camera.dart:49:22)
[        ] E/flutter ( 1610): #5      CameraController.startImageStream.<anonymous
closure> (package:camera/camera.dart:353:20)
[        ] E/flutter ( 1610): #6      _rootRunUnary (dart:async/zone.dart:1192:38)
[        ] E/flutter ( 1610): #7      _CustomZone.runUnary (dart:async/zone.dart:1085:19)
[        ] E/flutter ( 1610): #8      _CustomZone.runUnaryGuarded
(dart:async/zone.dart:987:7)
[        ] E/flutter ( 1610): #9      _BufferingStreamSubscription._sendData
(dart:async/stream_impl.dart:339:11)
[        ] E/flutter ( 1610): #10     _DelayedData.perform
(dart:async/stream_impl.dart:594:14)
[        ] E/flutter ( 1610): #11     _StreamImplEvents.handleNext
(dart:async/stream_impl.dart:710:11)
[        ] E/flutter ( 1610): #12     _PendingEvents.schedule.<anonymous closure>
(dart:async/stream_impl.dart:670:7)
[        ] E/flutter ( 1610): #13     _rootRun (dart:async/zone.dart:1180:38)
[        ] E/flutter ( 1610): #14     _CustomZone.run (dart:async/zone.dart:1077:19)
[        ] E/flutter ( 1610): #15     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
[   +1 ms] E/flutter ( 1610): #16     _CustomZone.bindCallbackGuarded.<anonymous closure>
(dart:async/zone.dart:1019:23)
[        ] E/flutter ( 1610): #17     _rootRun (dart:async/zone.dart:1184:13)
[        ] E/flutter ( 1610): #18     _CustomZone.run (dart:async/zone.dart:1077:19)
[        ] E/flutter ( 1610): #19     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
[        ] E/flutter ( 1610): #20     _CustomZone.bindCallbackGuarded.<anonymous closure>
(dart:async/zone.dart:1019:23)
[        ] E/flutter ( 1610): #21     _microtaskLoop
(dart:async/schedule_microtask.dart:43:21)
[        ] E/flutter ( 1610): #22     _startMicrotaskLoop
(dart:async/schedule_microtask.dart:52:5)
[        ] E/flutter ( 1610): 
[ +482 ms] W/System  ( 1610): A resource failed to call close. 
[   +1 ms] W/System  ( 1610): A resource failed to call destroy. 
[  +18 ms] I/chatty  ( 1610): uid=10403(com.example.examplerealtime) FinalizerDaemon
identical 1 line
[        ] W/System  ( 1610): A resource failed to call destroy. 
[+7729 ms] I/CameraManagerGlobal( 1610): Camera 0 facing CAMERA_FACING_BACK state now
CAMERA_STATE_CLOSED for client com.example.examplerealtime API Level 2
[+14766毫秒]D/ViewRootImpl@454dd0a[MainActivity](1610):ViewPostIme指针0
[+133毫秒]D/ViewRootImpl@454dd0a[MainActivity](1610):ViewPostIme指针1
[+13 ms]I/tflite(1610):初始化的TensorFlow Lite运行时。
[+36 ms]I/flatter(1610):成功
[+12毫秒]I/CameraManager全局(1610):摄像头0面向摄像头\u面向摄像头\u现在返回状态
摄像头\状态\为客户端com打开。示例。示例实时API 2级
[+9毫秒]D/传感器管理器(1610):寄存器列表器::1,LSM6DSO加速度传感器,
200000, 0,
[+86 ms]W/Gralloc3(1610):不支持分配器3.x
[+573毫秒]I/CameraManager全局(1610):摄像头0面向摄像头\u面向摄像头\u现在返回状态
客户端com的摄像头\状态\活动。示例。示例实时API级别2
[+37毫秒]I/CameraManager全球(1610):摄像头0面向摄像头\u面向摄像头\u现在返回状态
客户端com的摄像头\状态\空闲。示例。示例实时API级别2
[+146毫秒]我/编舞(1610):跳过44帧!应用程序可能也在运行
在它的主线上做了很多工作。
[+499毫秒]I/CameraManager全局(1610):摄像头0面向摄像头\u面向摄像头\u现在返回状态
客户端com的摄像头\状态\活动。示例。示例实时API级别2
[+118 ms]D/RenderScript HIDL自适应(1610):IRenderScriptDevice::getService()
[+11 ms]D/RenderScript HIDL自适应(1610):IRenderScriptDevice::getService()
返回0x78d5593060
[]D/RenderScript HIDL自适应(1610):HIDL已成功加载。
[+1 ms]V/RenderScript(1610):ARM(64位)RenderScript计算驱动程序
[+40 ms]V/RenderScript(1610):已成功加载运行时:librsdriverram.so
[+1 ms]D/(1610):已成功查询缓存目录:
/数据/user\u de/0/com.example.example实时/code\u缓存
[]D/RenderScript(1610):设置缓存目录:
/数据/user\u de/0/com.example.example实时/code\u缓存
[+31 ms]E/MethodChannel#tflite(1610):无法处理方法调用
[]E/MethodChannel#tflite(1610):java.lang.IllegalArgumentException:不支持
值:java.lang.ArrayIndexOutOfBoundsException:length=2;指数=3
[]E/MethodChannel#tflite(1610):位于
io.flatter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:278)
[]E/MethodChannel#tflite(1610):位于
io.flatter.plugin.common.StandardMethodCodec.encodeErrorEnvelope(StandardMethodCodec.java
:69)
[]E/MethodChannel#tflite(1610):位于
io.flatter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.错误(MethodChannel.ja
弗吉尼亚州:236)
[]E/MethodChannel#tflite(1610):位于
sq.flatter.tflite.TflitePlugin.onMethodCall(TflitePlugin.java:113)
[]E/MethodChannel#tflite(1610):位于
io.flatter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel。
爪哇:226)
[]E/MethodChannel#tflite(1610):位于
io.flatter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:8
5)
[]E/MethodChannel#tflite(1610):位于
io.flatter.embedding.engine.flatterjni.handlePlatformMessage(flatterjni.java:631)
[]E/MethodChannel#tflite(1610):位于
android.os.MessageQueue.nativePollOnce(本机方法)
[]E/MethodChannel#tflite(1610):位于
下一步(MessageQueue.java:336)
[]E/MethodChannel#tflite(1610):位于android.os.Looper.loop(Looper.java:197
)
[]E/MethodChannel#tflite(1610):位于
main(ActivityThread.java:7777)
[]E/MethodChannel#tflite(1610):位于java.lang.reflect.Method.invoke(本机)
(方法)
[]E/MethodChannel#tflite(1610):位于
RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
[]E/MethodChannel#tflite(1610):位于
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)
[+4 ms]E/flatter(1610):[错误:flatter/lib/ui/ui\u dart\u state.cc(157)]未处理
异常:PlatformException(错误,不支持的值:
java.lang.ArrayIndexOutOfBoundsException:长度=2;索引=3,null)
[]电子/颤振(1610):#0标准方法编解码器.decode信封
(软件包:flatter/src/services/message_编解码器。dart:569:7)
[]E/颤振(1610):#1个方法通道。U调用方法
(包装:颤振/src/服务/平台通道。dart:156:18)
[]E/颤振(1610):
[]E/颤振(1610):#2方法Channel.invokeMethod
(包装:颤振/src/服务/平台通道。dart:329:12)
[]E/颤振(1610):#3 Tflite.runModelOnFrame
(包装:tflite/tflite.省道:67:27)
[]E/颤振(1610):#4#CameraState.initState。。(包装:颤振实时检测/摄像机。dart:49:22)
[]E/颤振(1610):#5 CameraController.startImageStream。(包装:照相机/照相机.省道:353:20)
[]E/flatter(1610):#6(dart:async/zone.dart:1192:38)
[]E/flatter(1610):#7_CustomZone.runUnary(dart:async/zone.dart:1085:19)
[]E/颤振(1610):#8_CustomZone.runUnaryGuarded
(省道:异步/分区。省道:987:7)
[]电子/颤振(1610):#9"缓冲流订阅。"发送数据
(dart:async/stream\u impl.dart:339:11)
[]E/颤振(1610):#10#u DelayedData.perform
(dart:async/stream\u impl.dart:594:14)
[]E/颤振(1610):#11#u StreamImplEvents.handleNext
(dart:async/stream\u impl.dart:710:11)
[]E/颤振(1610):#12 _PendingEvents.schedule。
(dart:async/stream\u impl.dart:670:7)
[]E/flatter(1610):#13 40; dart:async/zone.dart:1180:38)
[]E/flatter(1610):#14 _CustomZone.run(dart:async/zone.dart:1077:19)
[]E/颤振(1610):#15#自定义区。
[+14766 ms] D/ViewRootImpl@454dd0a[MainActivity]( 1610): ViewPostIme pointer 0
[ +133 ms] D/ViewRootImpl@454dd0a[MainActivity]( 1610): ViewPostIme pointer 1
[  +13 ms] I/tflite  ( 1610): Initialized TensorFlow Lite runtime.
[  +36 ms] I/flutter ( 1610): success
[  +12 ms] I/CameraManagerGlobal( 1610): Camera 0 facing CAMERA_FACING_BACK state now
CAMERA_STATE_OPEN for client com.example.examplerealtime API Level 2
[   +9 ms] D/SensorManager( 1610): registerListener :: 1, LSM6DSO Acceleration Sensor,
200000, 0,
[  +86 ms] W/Gralloc3( 1610): allocator 3.x is not supported
[ +573 ms] I/CameraManagerGlobal( 1610): Camera 0 facing CAMERA_FACING_BACK state now
CAMERA_STATE_ACTIVE for client com.example.examplerealtime API Level 2
[  +37 ms] I/CameraManagerGlobal( 1610): Camera 0 facing CAMERA_FACING_BACK state now
CAMERA_STATE_IDLE for client com.example.examplerealtime API Level 2
[ +146 ms] I/Choreographer( 1610): Skipped 44 frames!  The application may be doing too
much work on its main thread.
[ +499 ms] I/CameraManagerGlobal( 1610): Camera 0 facing CAMERA_FACING_BACK state now
CAMERA_STATE_ACTIVE for client com.example.examplerealtime API Level 2
[ +118 ms] D/RenderScript HIDL Adaptation( 1610): IRenderScriptDevice::getService()
[  +11 ms] D/RenderScript HIDL Adaptation( 1610): IRenderScriptDevice::getService()
returned 0x78d5593060
[        ] D/RenderScript HIDL Adaptation( 1610): HIDL successfully loaded.
[   +1 ms] V/RenderScript( 1610): ARM mali (64 bit) RenderScript Compute Driver
[  +40 ms] V/RenderScript( 1610): Successfully loaded runtime: libRSDriverArm.so
[   +1 ms] D/        ( 1610): Successfully queried cache dir:
/data/user_de/0/com.example.examplerealtime/code_cache
[        ] D/RenderScript( 1610): Setting cache dir:
/data/user_de/0/com.example.examplerealtime/code_cache
[  +31 ms] E/MethodChannel#tflite( 1610): Failed to handle method call
[        ] E/MethodChannel#tflite( 1610): java.lang.IllegalArgumentException: Unsupported
value: java.lang.ArrayIndexOutOfBoundsException: length=2; index=3
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:278)
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.plugin.common.StandardMethodCodec.encodeErrorEnvelope(StandardMethodCodec.java
:69)
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.ja
va:236)
[        ] E/MethodChannel#tflite( 1610):       at
sq.flutter.tflite.TflitePlugin.onMethodCall(TflitePlugin.java:113)
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.
java:226)
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:8
5)
[        ] E/MethodChannel#tflite( 1610):       at
io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
[        ] E/MethodChannel#tflite( 1610):       at
android.os.MessageQueue.nativePollOnce(Native Method)
[        ] E/MethodChannel#tflite( 1610):       at
android.os.MessageQueue.next(MessageQueue.java:336)
[        ] E/MethodChannel#tflite( 1610):       at android.os.Looper.loop(Looper.java:197
)
[        ] E/MethodChannel#tflite( 1610):       at
android.app.ActivityThread.main(ActivityThread.java:7777)
[        ] E/MethodChannel#tflite( 1610):       at java.lang.reflect.Method.invoke(Native
Method)
[        ] E/MethodChannel#tflite( 1610):       at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
[        ] E/MethodChannel#tflite( 1610):       at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)
[   +4 ms] E/flutter ( 1610): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled
Exception: PlatformException(error, Unsupported value:
java.lang.ArrayIndexOutOfBoundsException: length=2; index=3, null)
[        ] E/flutter ( 1610): #0      StandardMethodCodec.decodeEnvelope
(package:flutter/src/services/message_codecs.dart:569:7)
[        ] E/flutter ( 1610): #1      MethodChannel._invokeMethod
(package:flutter/src/services/platform_channel.dart:156:18)
[        ] E/flutter ( 1610): <asynchronous suspension>
[        ] E/flutter ( 1610): #2      MethodChannel.invokeMethod
(package:flutter/src/services/platform_channel.dart:329:12)
[        ] E/flutter ( 1610): #3      Tflite.runModelOnFrame
(package:tflite/tflite.dart:67:27)
[        ] E/flutter ( 1610): #4      _CameraState.initState.<anonymous
closure>.<anonymous closure> (package:flutter_realtime_detection/camera.dart:49:22)
[        ] E/flutter ( 1610): #5      CameraController.startImageStream.<anonymous
closure> (package:camera/camera.dart:353:20)
[        ] E/flutter ( 1610): #6      _rootRunUnary (dart:async/zone.dart:1192:38)
[        ] E/flutter ( 1610): #7      _CustomZone.runUnary (dart:async/zone.dart:1085:19)
[        ] E/flutter ( 1610): #8      _CustomZone.runUnaryGuarded
(dart:async/zone.dart:987:7)
[        ] E/flutter ( 1610): #9      _BufferingStreamSubscription._sendData
(dart:async/stream_impl.dart:339:11)
[        ] E/flutter ( 1610): #10     _DelayedData.perform
(dart:async/stream_impl.dart:594:14)
[        ] E/flutter ( 1610): #11     _StreamImplEvents.handleNext
(dart:async/stream_impl.dart:710:11)
[        ] E/flutter ( 1610): #12     _PendingEvents.schedule.<anonymous closure>
(dart:async/stream_impl.dart:670:7)
[        ] E/flutter ( 1610): #13     _rootRun (dart:async/zone.dart:1180:38)
[        ] E/flutter ( 1610): #14     _CustomZone.run (dart:async/zone.dart:1077:19)
[        ] E/flutter ( 1610): #15     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
[   +1 ms] E/flutter ( 1610): #16     _CustomZone.bindCallbackGuarded.<anonymous closure>
(dart:async/zone.dart:1019:23)
[        ] E/flutter ( 1610): #17     _rootRun (dart:async/zone.dart:1184:13)
[        ] E/flutter ( 1610): #18     _CustomZone.run (dart:async/zone.dart:1077:19)
[        ] E/flutter ( 1610): #19     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
[        ] E/flutter ( 1610): #20     _CustomZone.bindCallbackGuarded.<anonymous closure>
(dart:async/zone.dart:1019:23)
[        ] E/flutter ( 1610): #21     _microtaskLoop
(dart:async/schedule_microtask.dart:43:21)
[        ] E/flutter ( 1610): #22     _startMicrotaskLoop
(dart:async/schedule_microtask.dart:52:5)
[        ] E/flutter ( 1610): 
[ +482 ms] W/System  ( 1610): A resource failed to call close. 
[   +1 ms] W/System  ( 1610): A resource failed to call destroy. 
[  +18 ms] I/chatty  ( 1610): uid=10403(com.example.examplerealtime) FinalizerDaemon
identical 1 line
[        ] W/System  ( 1610): A resource failed to call destroy. 
[+7729 ms] I/CameraManagerGlobal( 1610): Camera 0 facing CAMERA_FACING_BACK state now
CAMERA_STATE_CLOSED for client com.example.examplerealtime API Level 2