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

Android: null is not an object evaluating TfliteReactNative.loadmodel #2

Closed mdcroce closed 5 years ago

mdcroce commented 5 years ago

Thanks for this project, it seems quite good. I'm getting this issue when I try to run it on Android. Could you please help me?

Thanks!

shaqian commented 5 years ago

Hi, looks like the library is not linked to your project properly. Can you please try manually linking it? https://github.com/shaqian/tflite-react-native#android

chirag773 commented 5 years ago

Hey I'm getting the same problem can you please help me Could not invoke TfliteReactNative.loadModel null

chirag773 commented 5 years ago

Hi, looks like the library is not linked to your project properly. Can you please try manually linking it? https://github.com/shaqian/tflite-react-native#android

I had done this manually but still I'm facing the same error

techgig17 commented 5 years ago

I am facing the same error. Tried linking it manually too. Pls help as this is critical for the project

xunaizhong20 commented 5 years ago

Thanks for this project, it seems quite good. I'm getting this issue when I try to run it on Android. Could you please help me?

Thanks!

Android In Android Studio (1.0 & above), right-click on the app folder and go to New > Folder > Assets Folder. Click Finish to create the assets folder.

Place the model and label files at app/src/main/assets.

In android/app/build.gradle, add the following setting in android block.

aaptOptions {
    noCompress 'tflite'
}
LorandP commented 5 years ago

I have the same issue and already added the resources to android but is still not working. Also I have downloaded two other models from elsewhere and they are working fine and I have added them to android. So maybe the models that are not working are the problem?

shaqian commented 5 years ago

Hi, have you tried to launch the app in Android Studio? You will be able to get more verbose trace.

LorandP commented 5 years ago

Yes, I have tried and I get: Caused by: java.io.FileNotFoundException: models/model2.tflite But my model is in that directory, I don't understand why I get this.

sunilgc7 commented 5 years ago

I have also faced same issue

shaqian commented 5 years ago

@LorandP @sgc445 Please make sure you copied the models folder to app/src/main/assets and confirm it from Android Studio.

sunilgc7 commented 5 years ago

Thanks, Solved my issue.

alessandroraffa commented 5 years ago

Same issue on iOS

@LorandP @sgc445 Please make sure you copied the models folder to app/src/main/assets and confirm it from Android Studio.

Where exactly should I put models for iOS?

Thanks in advance.

RaviKiranMakala commented 3 years ago

Same issue on iOS

@LorandP @sgc445 Please make sure you copied the models folder to app/src/main/assets and confirm it from Android Studio.

Where exactly should I put models for iOS?

Thanks in advance.

Any luck? I am able to run it on Android, but facing the issue with iOS. How would i add the models to iOS project exactly.