Error: Based on the provided shape, [1,1,16,32], and dtype float32, the tensor should have 512 values but has 93
See original GitHub issueHi! I’m having trouble making the library work on production. Everything works perfect locally. Using angular 4. Here is the code:
const detections: Array<any> = await faceapi.detectAllFaces(this.video, new faceapi.TinyFaceDetectorOptions({ inputSize: 128, scoreThreshold: 0.4 }));
ERROR Error: Uncaught (in promise): Error: Based on the provided shape, [1,1,16,32], and dtype float32, the tensor should have 512 values but has 93 Error: Based on the provided shape, [1,1,16,32], and dtype float32, the tensor should have 512 values but has 93 at c (scripts.208b17eda93ff84a86fa.bundle.js:1) at new t (scripts.208b17eda93ff84a86fa.bundle.js:1) at Function.t.make (scripts.208b17eda93ff84a86fa.bundle.js:1) at Ht (scripts.208b17eda93ff84a86fa.bundle.js:1) at o (scripts.208b17eda93ff84a86fa.bundle.js:1) at $a (scripts.208b17eda93ff84a86fa.bundle.js:1) at scripts.208b17eda93ff84a86fa.bundle.js:1 at Array.forEach (<anonymous>) at scripts.208b17eda93ff84a86fa.bundle.js:1 at Array.forEach (<anonymous>) at c (scripts.208b17eda93ff84a86fa.bundle.js:1) at new t (scripts.208b17eda93ff84a86fa.bundle.js:1) at Function.t.make (scripts.208b17eda93ff84a86fa.bundle.js:1) at Ht (scripts.208b17eda93ff84a86fa.bundle.js:1) at o (scripts.208b17eda93ff84a86fa.bundle.js:1) at $a (scripts.208b17eda93ff84a86fa.bundle.js:1) at scripts.208b17eda93ff84a86fa.bundle.js:1 at Array.forEach (<anonymous>) at scripts.208b17eda93ff84a86fa.bundle.js:1 at Array.forEach (<anonymous>) at S (polyfills.b05dc6a29a1cfeb080d6.bundle.js:1) at polyfills.b05dc6a29a1cfeb080d6.bundle.js:1 at a (main.424b2f298a047510607b.bundle.js:1) at t.invoke (polyfills.b05dc6a29a1cfeb080d6.bundle.js:1) at Object.onInvoke (main.424b2f298a047510607b.bundle.js:1) at t.invoke (polyfills.b05dc6a29a1cfeb080d6.bundle.js:1) at e.run (polyfills.b05dc6a29a1cfeb080d6.bundle.js:1) at polyfills.b05dc6a29a1cfeb080d6.bundle.js:1 at t.invokeTask (polyfills.b05dc6a29a1cfeb080d6.bundle.js:1) at Object.onInvokeTask (main.424b2f298a047510607b.bundle.js:1) $ @ main.424b2f298a047510607b.bundle.js:1 t.handleError @ main.424b2f298a047510607b.bundle.js:1 next @ main.424b2f298a047510607b.bundle.js:1 e.object.i @ main.424b2f298a047510607b.bundle.js:1 e.__tryOrUnsub @ main.424b2f298a047510607b.bundle.js:1 e.next @ main.424b2f298a047510607b.bundle.js:1 e._next @ main.424b2f298a047510607b.bundle.js:1 e.next @ main.424b2f298a047510607b.bundle.js:1 e.next @ main.424b2f298a047510607b.bundle.js:1 e.emit @ main.424b2f298a047510607b.bundle.js:1 (anonymous) @ main.424b2f298a047510607b.bundle.js:1 t.invoke @ polyfills.b05dc6a29a1cfeb080d6.bundle.js:1 e.run @ polyfills.b05dc6a29a1cfeb080d6.bundle.js:1 t.runOutsideAngular @ main.424b2f298a047510607b.bundle.js:1 onHandleError @ main.424b2f298a047510607b.bundle.js:1 t.handleError @ polyfills.b05dc6a29a1cfeb080d6.bundle.js:1 e.runGuarded @ polyfills.b05dc6a29a1cfeb080d6.bundle.js:1 t @ polyfills.b05dc6a29a1cfeb080d6.bundle.js:1 n.microtaskDrainDone @ polyfills.b05dc6a29a1cfeb080d6.bundle.js:1 d @ polyfills.b05dc6a29a1cfeb080d6.bundle.js:1
Also the video is 351x360 pixels
Issue Analytics
- State:
- Created 5 years ago
- Comments:22 (1 by maintainers)
Top GitHub Comments
It was actually a different problem - the json files managed to get loaded, but the non extension files (e.g. “age_gender_model-shard1”) weren’t. So what I did - I used my downloaded “weights” folder (and not the cdn), and for each model I :
For example:
"paths":["age_gender_model-shard1"]
to:"paths":["age_gender_model-shard1.shard"]
Pay attention that some manifest.json files have 2 paths
I managed to solve it serving model files from a cdn Use https://gitcdn.xyz/repo/justadudewhohacks/face-api.js/master/weights/ as
MODEL_URL