justadudewhohacks / face-api.js

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

failed to link vertex and fragment shaders #282

Open zifeiyuSun opened 5 years ago

zifeiyuSun commented 5 years ago

I import "face-api.js": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/face-api.js/-/face-api.js-0.19.0.tgz", "integrity": "sha512-XbEIqqnLzlVIkvtLffFIl/Ltit3VAnJ1B3aFEc28pnkNVvqzJnBJbZVgbJ0JTvaafdSPJ5pFufC2t0KZJhwdpw==", "requires": { "@tensorflow/tfjs-core": "1.0.3", "tfjs-image-recognition-base": "^0.5.1", "tslib": "^1.9.3" }, "dependencies": { "tslib": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" } } }, but I got an error in chrome 70 in windows, as follows:

99
zifeiyuSun commented 5 years ago

If can I update tensorflow to "dependencies": { "@tensorflow/tfjs-converter": "1.1.0", "@tensorflow/tfjs-core": "1.1.0", "@tensorflow/tfjs-data": "1.1.0", "@tensorflow/tfjs-layers": "1.1.0" }

zifeiyuSun commented 5 years ago

EADBE271B539976EDD5C697E318419FB chrome 73 also has same issue... 7B2F30A04C43DB51A733B2F78618E808

How to solve it ? please help me , thank you very much.

zifeiyuSun commented 5 years ago

https://github.com/llSourcell/pose_estimation/issues/9 give the answer, but I update to 1.0.4, still has the issue....sigh...

justadudewhohacks commented 5 years ago

This either is a problem with your machine (I think the tfjs team has a sample page somewhere, where you can check the capabilites related to the WebGL backend), or the problem is due to unaligned package versions. face-api.js is currently using @tensorflow/tfjs-core 1.0.3, so you should use this version.

yaffaharari commented 5 years ago

I got the same error. does you founded resolve to that?

PutziSan commented 5 years ago

The error also occurs in our app, but only with chrome on older devices (8gb RAM, intel core i5 M 560 2.67 GHz). On the same devices it works with firefox. On new devices it works with chrome as well as with firefox.

image

Then, I set tf.ENV.set('WEBGL_PACK', false) at the beginning of my app (from this sstackoverflow-comment). On new devices it works again, on the older device the error Box.constructor - expected box to be IBoundingBox | IRect, instead have ... appears.

image

zjlovezj commented 5 years ago

@PutziSan I got this error too. I resolved it by setting below specific inputSize:

new faceapi.TinyFaceDetectorOptions({
      inputSize: 256, // this line solves 'Box.constructor - expected box to be IBoundingBox | IRect, instead ...'
      scoreThreshold: 0.5,
    });

I believe blow inputSize also works: https://github.com/justadudewhohacks/tfjs-image-recognition-base/blob/master/src/tinyYolov2/TinyYolov2.ts#L27

veetechh commented 5 years ago

Hi,

@PutziSan I got this error too. I resolved it by setting below specific inputSize:

new faceapi.TinyFaceDetectorOptions({
      inputSize: 256, // this line solves 'Box.constructor - expected box to be IBoundingBox | IRect, instead ...'
      scoreThreshold: 0.5,
    });

I believe blow inputSize also works: https://github.com/justadudewhohacks/tfjs-image-recognition-base/blob/master/src/tinyYolov2/TinyYolov2.ts#L27

This didnt work for me. Is there any solution for Chrome ?

felipebutcher commented 3 years ago

I was having this error when running the html served in a node environment. Running it from traditional apache works fine.