justadudewhohacks / face-api.js

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

Error: Failed to link vertex and fragment shaders. #327

Closed yaffaharari closed 5 years ago

yaffaharari commented 5 years ago

I get this error:

‏‏errorImg

package.json:

{ "name": "eyes-blinking", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "~7.2.0", "@angular/cdk": "~7.3.7", "@angular/common": "~7.2.0", "@angular/compiler": "~7.2.0", "@angular/core": "~7.2.0", "@angular/flex-layout": "^8.0.0-beta.25", "@angular/forms": "~7.2.0", "@angular/material": "^7.3.7", "@angular/platform-browser": "~7.2.0", "@angular/platform-browser-dynamic": "~7.2.0", "@angular/router": "~7.2.0", "core-js": "^2.5.4", "face-api.js": "^0.20.0", "hammerjs": "^2.0.8", "ngx-webcam": "^0.2.2", "rxjs": "~6.3.3", "tracking": "^1.1.3", "tslib": "^1.9.0", "webpack": "^4.32.0", "zone.js": "~0.8.26", "@tensorflow/tfjs-core": "1.0.4", "tfjs-image-recognition-base": "^0.5.1" }, "devDependencies": { "@angular-devkit/build-angular": "~0.13.0", "@angular/cli": "~7.3.6", "@angular/compiler-cli": "~7.2.0", "@angular/language-service": "~7.2.0", "@types/jasmine": "~2.8.8", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "@types/tracking": "^1.1.29", "codelyzer": "~4.5.0", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.0.0", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~1.1.2", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.4.0", "ts-node": "~7.0.0", "tslint": "~5.11.0", "typescript": "~3.2.2", "@tensorflow/tfjs-node": "^1.0.2" } }

MaxAlex666 commented 5 years ago

Similar error, browser Chrome 75.0.3770.100 (Windows 10, 64 bit) face-api.js v0.20.0 and 0.19.0

tf-core.esm.js:4786 C:\fakepath(180,2-134): error X3500: array reference cannot be used as an l-value; not natively addressable C:\fakepath(159,7-117): error X3511: forced to unroll loop, but unrolling failed. C:\fakepath(157,7-117): error X3511: forced to unroll loop, but unrolling failed.

Warning: D3D shader compilation failed with default flags. (ps_3_0) Retrying with avoid flow control C:\fakepath(180,2-134): error X3500: array reference cannot be used as an l-value; not natively addressable C:\fakepath(159,7-117): error X3511: forced to unroll loop, but unrolling failed. C:\fakepath(157,7-117): error X3511: forced to unroll loop, but unrolling failed.

Warning: D3D shader compilation failed with avoid flow control flags. (ps_3_0) Retrying with prefer flow control C:\fakepath(180,2-134): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll C:\fakepath(180,2-134): error X3500: array reference cannot be used as an l-value; not natively addressable C:\fakepath(159,7-117): error X3511: forced to unroll loop, but unrolling failed. C:\fakepath(157,7-117): error X3511: forced to unroll loop, but unrolling failed.

Warning: D3D shader compilation failed with prefer flow control flags. (ps_3_0) Failed to create D3D Shaders

Uncaught (in promise) Error: Failed to link vertex and fragment shaders. at xr (tf-core.esm.js:4786) at e.createProgram (tf-core.esm.js:5381) at tf-core.esm.js:5578 at tf-core.esm.js:8507 at e.getAndSaveBinary (tf-core.esm.js:8524) at e.compileAndRun (tf-core.esm.js:8506) at e.conv2dWithIm2Row (tf-core.esm.js:8277) at e.conv2d (tf-core.esm.js:8282) at We.engine.runKernel.x (tf-core.esm.js:9797) at tf-core.esm.js:1494

yaffaharari commented 5 years ago

try this: right click on computer -> properties -> task manager -> display adapters -> right click on your graphic card (I have Intel (R) HD Graphics 3000) and update driver, disable device, enable device. It should do the job

Archote commented 5 years ago

That didnt solved my problem

And I have Intel (R) HD Graphics 3000 too

justadudewhohacks commented 5 years ago

This error comes from the tfjs-core WebGL backend. Could be some device issue, for example some android devices too have the same issue: https://github.com/tensorflow/tfjs/issues/952, #151.

Closing since this is not really something that face-api.js has control over, probably better to file an issue at tfjs. I would also recommend playing around with some tfjs examples first, to see whether this issue occurs and which ops might cause this issue.

witalobenicio commented 5 years ago

@justadudewhohacks there's any workaround for this? In my case it's failing on all Samsung devices and Motorola.

emimassa commented 5 years ago

That didnt solved my problem And I have Intel (R) HD Graphics 4000 too, I5 and 6GB

yolisses commented 1 year ago

I use Ubuntu 22.04, Google Chrome 114.0.5735.133, and X.Org X server drivers for nVidia (default). It works using the option Launch using Discrete Graphics Card to open Chrome.