tf.ready() crashing React Native (Expo managed) app with no error
See original GitHub issueThis was working fine yesterday, but started crashing today. No changes to package.json. Only known upgrade was Expo CLI upgrade to 6.0.1 (early than today). No other known new software installed between yesterday and today.
System information
-
Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): No. Example code is crashing also.
-
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Started with macOS Monterey 12.4, upgraded to 12.5 with same result
-
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: iPhone 12 Pro, iOS 15.6
-
TensorFlow.js installed from (npm or script link): yarn
-
TensorFlow.js version (use command below): From the pose-detection example
"@mediapipe/pose": "~0.4.0",
"@react-native-async-storage/async-storage": "~1.17.3",
"@tensorflow-models/pose-detection": "2.0.0",
"@tensorflow/tfjs": "3.18.0",
"@tensorflow/tfjs-react-native": "0.8.0",
"expo": "~45.0.6",
"expo-camera": "^12.2.0",
"expo-file-system": "^14.0.0",
"expo-gl": "^11.3.0",
"expo-gl-cpp": "^11.3.0",
"expo-screen-orientation": "~4.2.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "0.68.2",
"react-native-fs": "2.14.1",
"react-native-gesture-handler": "~2.2.1",
"react-native-svg": "12.3.0"
- Browser version: n/a
- Tensorflow.js Converter Version: n/a
Describe the current behavior App crashing without error on the call to await tf.ready();
Describe the expected behavior await tf.ready() is successful
Standalone code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab/CodePen/any notebook.
Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top GitHub Comments
Hi @darringrove
Sorry, I was busy with some other projects…
I took a look, and it is probably caused by this bug. Apparently, expo go app was updated 3 days ago, which added the support to expo sdk 46. But for some reason, it crashes apps that uses expo-gl and expo sdk 45. I updated pose-detection to expo sdk 46 and it seems to work now (PR). Please give it a try. Thanks!
@rthadur @jinjingforever I’m not sure if this is a clue or not. I noticed in some other threads that calling
tf.setBackend
solved crashing problems.I tried
console.log(tf.getBackend());
beforeawait tf.ready()
. It returnsundefined
.I tried
await tf.setBackend('cpu');
beforeawait tf.ready()
(not sure this is the right backend), but with thistf.ready()
returned, but thenawait posedetection.createDetector
crashed the app.