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

Failed to run on Android Chrome #3

Open
hideya opened this issue May 10, 2018 · 2 comments
Open

Failed to run on Android Chrome #3

hideya opened this issue May 10, 2018 · 2 comments

Comments

@hideya
Copy link
Member

hideya commented May 10, 2018

Execution fails with the following error at the start up (during the warm-up) and when clicking "Guess" button.

A TF.js demo, Emoji Scavenger Hunt, that uses similar features, runs fine on Android Chrome, So, there should be a way to fix it.

Android version tested is 6.0 and TF.js is of version_core: "0.9.1". I don't have newer Android device, but I'm informed that Android 8.0 device failed to run this demo in the same manner.

Uncaught Error: Failed to compile fragment shader.
    at Object.createFragmentShader (webpack:///./node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util.js?:91)
    at GPGPUContext.createProgram (webpack:///./node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context.js?:166)
    at Object.compileProgram (webpack:///./node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_math.js?:25)
    at eval (webpack:///./node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.js?:775)
    at MathBackendWebGL.getAndSaveBinary (webpack:///./node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.js?:791)
    at MathBackendWebGL.compileAndRun (webpack:///./node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.js?:774)
    at MathBackendWebGL.conv2d (webpack:///./node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.js?:690)
    at environment_1.ENV.engine.runKernel.x (webpack:///./node_modules/@tensorflow/tfjs-core/dist/ops/conv.js?:83)
    at Engine.runKernel (webpack:///./node_modules/@tensorflow/tfjs-core/dist/engine.js?:72)
    at ConvOps.conv2d (webpack:///./node_modules/@tensorflow/tfjs-core/dist/ops/conv.js?:83)
@bfbca
Copy link
Contributor

bfbca commented Sep 9, 2018

Perhaps GPU runs out memory. This happens on older Android smartphone like Galaxy S5, but works on newer Galaxy S7 and Pixel 2 XL.

Adding tf.setBackend('cpu') as 1st line in window.onload in index.js fixes the crash on Galaxy S5, however recognition gets slow, around 10sec.

@hideya
Copy link
Member Author

hideya commented Sep 10, 2018

Thanks for the input and the fix! Yeah, it looks that Issue #2 is also caused by out-of-GPU-memory.
Merged your PR. Thank you!

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

No branches or pull requests

2 participants