How can I use Tensorflow with react-native?

This article explains using tensorflow with native android development. https://omid.al/posts/2017-02-20-Tutorial-Build-Your-First-Tensorflow-Android-App.html

I also needs a tf supporting library for react-native. But it seems as you said there is no library yet.

Here they have built an adroid app with react native with tensorflow support, have a look, https://github.com/NorthFoxz/whatsthis


Came across the following Platform Adapter for React Native.

This package provides a TensorFlow.js platform adapter for react native. It provides GPU accelerated execution of TensorFlow.js supporting all major modes of tfjs usage


There is also a library react-native-tensorflow bridging tensorflow with react-native.

A TensorFlow inference library for react native.

They have recently added support for iOS, so it's available for both Android and iOS platforms.

To get started:

$ npm install react-native-tensorflow --save

Perform library link:

$ react-native link react-native-tensorflow

For iOS you will also need to use CocoaPods with content:

target '<ProjectName>'
       pod 'TensorFlow-experimental'

There are performance limitations due to the nature of react-native bridge when transferring large data between native side and JS. For other known issues and usage check out the library's documentation.