justadudewhohacks / face-api.js

JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js
MIT License
16.7k stars 3.71k forks source link

[Android] Error on Live Demos: Failed to compile fragment shader. #151

Open wukann opened 5 years ago

wukann commented 5 years ago

I accessed the demo site (https://justadudewhohacks.github.io/face-api.js/face_and_landmark_detection/) on my Android device, but the face detection didn't work.

There was such an error.

Uncaught (in promise) Error: Failed to compile fragment shader.
    at createFragmentShader (/face-api.js/0-e459655e1a7a45356a06.js:250)
    at e.createProgram (/face-api.js/0-e459655e1a7a45356a06.js:250)
    at compileProgram (/face-api.js/0-e459655e1a7a45356a06.js:250)
    at /face-api.js/0-e459655e1a7a45356a06.js:250
    at e.getAndSaveBinary (/face-api.js/0-e459655e1a7a45356a06.js:250)
    at e.compileAndRun (/face-api.js/0-e459655e1a7a45356a06.js:250)
    at e.conv2d (/face-api.js/0-e459655e1a7a45356a06.js:250)
    at ENV.engine.runKernel.x (/face-api.js/0-e459655e1a7a45356a06.js:250)
    at /face-api.js/0-e459655e1a7a45356a06.js:250
    at e.scopedRun (/face-api.js/0-e459655e1a7a45356a06.js:250)

My device: Android 6.0.1 Chrome 70.0.3538.30 SONY Xperia A4

justadudewhohacks commented 5 years ago

Which face detector did you use, the default one, e.g. TinyFaceDetector?

wukann commented 5 years ago

@justadudewhohacks I got the same error in all detector...

justadudewhohacks commented 5 years ago

That's odd, may be some issue with the WebGL backend on your device. Did run any tfjs application on your Xperia before? If not you could try setting up a simple page running a conv2d operation, to see whether it is an issue with your device and if so report an issue at tfjs.

bryan-14four commented 5 years ago

This is a TFJS/device issue. I've hacked together a solution which works in my case (I'm also using face-api.js) here: https://github.com/tensorflow/tfjs/issues/952#issuecomment-468393905

pravinkumarputta commented 3 years ago

image

Hi, I'm also facing the same issue on Samsung Galaxy J2. I developed an app in Cordova and VueJs. It's working fine on some of the phones. Even if it does not work, it's ok for me but it does not throw any error to any of called functions. It's blocking the flow, so I'm using a timeout of 10sec to close the page. But some devices taking more than 10sec to load models, here it creates a problem for me.

I'm using this monkey path code:

Screenshot 2021-03-05 at 6 08 15 PM

Not getting where it's failing and where to add try-catch.

Does anyone have a solution for this?

IbrahimAliAsghar commented 3 years ago

having the same issue on Oppo A37, is there a patch/solution available to this issue?