tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

"Failed to link vertex and fragment shaders" while using Posenet on ios (Mobile Safari 18.1.1)

Open Pensarfeo opened this issue 1 year ago • 3 comments

Hi, I saw from my analytics this following error in production.

"Failed to link vertex and fragment shaders" while initializing posenet.

This is my initialization.

    const initTensor = zeros([256, 256, 3])
    await this.poseDetector.estimatePoses(initTensor)

It has only happened twice in the last couple of years but I would like to know what to do and how to try recovering the system.

I am quite sure the error happened on ios Mobile Safari 18.1.1.

these are the tfjs versions I use

@tensorflow-models/pose-detection": "^2.1.3 @tensorflow/tfjs-backend-webgl": "^4.21.0 @tensorflow/tfjs-backend-webgpu": "^4.21.0 @tensorflow/tfjs-converter": "^4.21.0 @tensorflow/tfjs-core": "^4.21.0

Any advice would be welcomed!

Pensarfeo avatar Nov 25 '24 11:11 Pensarfeo

Hi @Pensarfeo ,

I wasn't able to replicate the issue on my end, but based on my understading, it seems that the problem is related to your device running GPU out of memory. I believe images with a resolution of 256x256 should work fine with the poseDetector models, but larger images may cause memory issues.

I came across this discussion that might be helpful: Thread.

Thank You!!

shmishra99 avatar Nov 27 '24 18:11 shmishra99

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Dec 05 '24 02:12 github-actions[bot]

Hi @shmishra99, thanks for giving it a try :) I also never saw this issue, it seems rare, i have seen it only a few times on thousands of devices that used my app. My questions is more about how to handle the failure rather than how to fix it.

Shall I just try to run the model again? Shall I force reload the page? Is there a way to check how much memory is available?

Pensarfeo avatar Dec 07 '24 09:12 Pensarfeo