Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cameraWithTensors() crashes the app immediatly on Android 11/12 #6230

Closed
GewoonJaap opened this issue Mar 15, 2022 · 7 comments
Closed

cameraWithTensors() crashes the app immediatly on Android 11/12 #6230

GewoonJaap opened this issue Mar 15, 2022 · 7 comments

Comments

@GewoonJaap
Copy link

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS

  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: Android 11/12, no matter which device

  • Installed NPM packages:
    "@tensorflow-models/mobilenet": "^2.1.0",
    "@tensorflow/tfjs": "^3.14.0",
    "@tensorflow/tfjs-react-native": "^0.8.0",
    "expo-camera": "~12.1.2",

Describe the current behavior

The app crashes immediatly when calling import { Camera } from 'expo-camera'; cameraWithTensors(Camera); No error is thrown/can't catch the error with try catch

Describe the expected behavior
The app should not crash or atleast throw an error

Standalone code to reproduce the issue
https://pastebin.com/raw/JAMdvYTy

@GewoonJaap GewoonJaap added the type:bug Something isn't working label Mar 15, 2022
@Guerrero25
Copy link

I am having the same problem. App crashes with no catchable error right after call await tf.ready()

Installed NPM packages:
"@tensorflow-models/mobilenet": "^2.1.0",
"@tensorflow/tfjs": "^3.14.0",
"@tensorflow/tfjs-react-native": "^0.8.0",
"expo-camera": "~12.1.2",

@GewoonJaap GewoonJaap changed the title cameraWithTensors() lets the app crash immediatly on Android 11/12 cameraWithTensors() crashes the app immediatly on Android 11/12 Mar 15, 2022
@lahiru-98
Copy link

I am having the same issue mentioned by @GewoonJaap App crashes with no catchable error

@ducdh-dev
Copy link

I am having the same issue. Any help would be appreciated :(

@jinjingforever
Copy link
Collaborator

Hi,

Sorry for the delay. We finally got a phone that can run Android 12:)

Looks like this is a bug in expo-gl. See here. The only workaround seems to be downgrading expo to 43.0.5 for now. This should fix the crash (tested on Pixel 6)

At this point, you might also notice that the key points no longer appear (or at seemingly random places). If so, add the following before loading the model:

tf.env().set('WEBGL_PACK_DEPTHWISECONV', false);

Give it a try! Thanks

@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you.

@google-ml-butler
Copy link

Closing as stale. Please @mention us if this needs more attention.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants