TypeError: t.toFloat is not a function TensorFlow with Angular

Viewed 681

I am trying to integrate TensorFlow Facemesh in Angular Application. I have imported all required modules and tried different model.

I am using following :

import * as tf from '@tensorflow/tfjs';
import * as facemesh from '@tensorflow-models/facemesh';

Function :

    const faceEstimate = await model.estimateFaces(video));
    console.log(faceEstimate);

I am facing this error :

(in promise): TypeError: t.toFloat is not a function
TypeError: t.toFloat is not a function
    at facemesh.esm.js:17

I using Angular 10. Please help with this.

Update: I tried a Different Model with MediaPipe, which also gives the same error.

1 Answers

had the same issue and solved by currently downgrading to the version to 2.6.0 "@tensorflow/tfjs-backend-webgl": "^2.6.0", "@tensorflow/tfjs-converter": "^2.6.0", "@tensorflow/tfjs-core": "^2.6.0",

Related