googlesamples / arcore-ml-sample

Apache License 2.0
75 stars 32 forks source link

custome model doesn't work #8

Open chanakamendis03 opened 1 year ago

chanakamendis03 commented 1 year ago

I have import a custome model and edited MLKitObjectDetector for custom model . but after i run and scan it crash the app .

the error

2023-07-27 15:08:15.121 10224-10392/com.google.ar.core.examples.java.ml E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-1
    Process: com.google.ar.core.examples.java.ml, PID: 10224
    com.google.mlkit.common.MlKitException: Failed to initialize detector. Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to preprocess input images.
        at com.google.mlkit.vision.vkp.PipelineManager.start(com.google.mlkit:vision-internal-vkp@@18.0.0:63)
        at com.google.mlkit.vision.objects.custom.internal.zzg.tryLoad(com.google.mlkit:object-detection-custom@@16.3.1:3)
        at com.google.mlkit.common.sdkinternal.model.CustomModelLoader.load(com.google.mlkit:common@@17.1.1:3)
        at com.google.mlkit.vision.objects.custom.internal.zzh.load(com.google.mlkit:object-detection-custom@@16.3.1:2)
        at com.google.mlkit.common.sdkinternal.ModelResource.zza(Unknown Source:18)
        at com.google.mlkit.common.sdkinternal.zzn.run(Unknown Source:10)
        at com.google.mlkit.common.sdkinternal.zzp.run(com.google.mlkit:common@@17.1.1:2)
        at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze(com.google.mlkit:common@@17.1.1:4)
        at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc(Unknown Source:8)
        at com.google.mlkit.common.sdkinternal.zzj.run(Unknown Source:2)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
        at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd(Unknown Source:10)
        at com.google.mlkit.common.sdkinternal.zzk.run(Unknown Source:2)
        at java.lang.Thread.run(Thread.java:1012)
chanakamendis03 commented 1 year ago

it worked after I added metedata to tensorFlower model