shaqian / tflite-react-native

React Native library for TensorFlow Lite
https://www.npmjs.com/package/tflite-react-native
MIT License
291 stars 106 forks source link

EXC_BAD_ACCESS error on IOS #30

Open maslovay opened 3 years ago

maslovay commented 3 years ago

I'm using custom SSD model (I tried my own and three other models that were trained by users)

They work fine in Android, but in IOS it fails here:

if (interpreter->AllocateTensors() != kTfLiteOk) {
    callback(@[@"Failed to allocate tensors!"]);
  }

With EXC_BAD_ACCESS

When I use ssd_mobilenet.tflite from model Zoo IOS does not throw error

BILLXZY1215 commented 3 years ago

Same issue here. Any workaround?

ananta commented 2 years ago

Any solution over here? I'm facing the same issue :)

BILLXZY1215 commented 2 years ago

Hey guys, are you using the customized tflite model? It works fine with my machine when I use the default model, but not for the customized models. I think when generating tflite files, the version of tensorflow-lite should be specified. This repo only accepts tensorflow-lite r1.12, which means the tflite file generated by other versions might not match the interpreter. In this case, you may need to replace these files:

ios/Pods/TensorflowLite/Frameworks/tensorflow_lite.framework/Headers/Tensorflow to a suitable version (e.g. tensorflow r2.8) ios/Pods/TensorflowLite/Frameworks/tensorflow_lite.framework/Headers/flatbuffers to a suitable version (e.g. flatbuffer 1.12, which will match tf r2.8)