is it possible to use Tensorflow js custom model from local file in react native?

Viewed 26

I am trying to use a custom Tensorflow.js model in react native using React Native CLI.

It seems that @tensorflow/tfjs-react-native is not maintained anymore. When I try to install it based on the instructions provided on the official GitHub page, I face many dependency conflicts that are impossible to resolve. So this fact renders the package useless.

Also, tflite is not an option either based on the nature of my model(Details are irrelevant, though I would gladly explain if it would help in solving my problem). But even if I wanted to use that format, I doubt it would work because the package available for that also looks deprecated considering it was last updated around 3 years ago.

And for the same reason(Model's Nature), despite having a fully updated package, ONNX is currently not an option either.

So that leaves me with Tensorflow.js. And I should mention that I know the hardware limitations involved in using this too.

So my question is, considering the things I've said above, is there a way to use Tensorflow.js meaning this package in react native, and load a custom model to make predictions? or should I just give up? If yes, please do share a simple working piece of code.

Also, my model is a Keras model saved in Tensorflow.js format. Finally, I also tried loading a model from a URL but no luck there too(Note that I am not trying to imply that it is impossible, I am merely saying that I was not able to do it. Would be awesome if you could tell me a way to do that too if possible of course.)

Thanks in advance for your time. If there is anything unclear, tell and I will try to elaborate more.

0 Answers
Related