question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[tfjs-react-native] and managed Expo workflows

See original GitHub issue

With, @tensorflow/tfjs-react-native@0.2.1, tfjs-react-native is using react-native-fs for the bundleResourceIO function. To the best of my knowledge, managed Expo workflows do not work with react-native-fs, instead, the recommended path is to use expo-file-system. Attempting to run a managed Expo app results in this error at runtime: TypeError: null is not an object (evaluating 'RNFSManager.RNFSFileTypeRegular').

To work around this, I forked the repo, and changed the bundle loading code into a stub. I published this code to NPM, installed it and ran it successfully in the context of a managed Expo workflow. I managed to get the example realtime demo working.

Based on the README, it appears that managed Expo workflows are within the set of project types supported by tfjs-react-native, hence this issue.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
tafsiricommented, Feb 11, 2020

0.2.2 is out on NPM https://www.npmjs.com/package/@tensorflow/tfjs-react-native @robsco-git @jgough99 @MichaelMcNeil, give it a whirl and let me know if it doesn’t solve the issue.

1reaction
tafsiricommented, Feb 12, 2020

Yes, once the component is unmounted the generator will be exhausted and this is expected behaviour. Another way to not have the null check is to cancel the requestAnimationFrame of this parent component. This is how i handled it in the updated demo https://github.com/tensorflow/tfjs/blob/master/tfjs-react-native/integration_rn59/components/webcam/realtime_demo.tsx#L126

Read more comments on GitHub >

github_iconTop Results From Across the Web

tfjs-react-native-expo-fix - npm
js platform adapter for react native. It provides GPU accelerated execution of TensorFlow.js supporting all major modes of tfjs usage, include:.
Read more >
Workflows - Expo Documentation
The managed workflow is kind of like Rails and Create React App, but for React Native. Developers build managed workflow apps using Expo...
Read more >
Deep learning for natural language processing on mobile ...
Reading Comprehension using Expo, React-Native, TensorFlow.js, and MobileBERT. ... I choose the tabs template of Expo managed workflow to generate several ...
Read more >
Tensorflow or keras support | Voters - Expo - Canny
expo -gl. called. @tensorflow/tfjs-react-native ... Tyler Slater I just came across this...which looks like it might work with managed expo apps:.
Read more >
loadLayersModel() or loadGraphModel() for TensorflowJS
I am using this in React Native with expo project. not sure if that ... import * as tf from '@tensorflow/tfjs' import {...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found