angular - TypeError: t.toFloat is not a function TensorFlow with Angular
问题描述
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.
解决方案
有同样的问题并通过当前降级到 2.6.0 "@tensorflow/tfjs-backend-webgl": "^2.6.0", "@tensorflow/tfjs-converter": "^2.6.0", "@tensorflow/tfjs-core": "^2.6.0",
推荐阅读
- sql - SQL:连接两个表时获得“滚动”平均值
- vhdl - 仅在 Modelsim 上出现未知标识符错误?
- uwp - 构建 Ionic 4 Cordova 通用 Windows 应用程序显示白屏
- javascript - 使用 Flask 时 Javascript 请求导致未定义
- django-models - 使用 Django 1.11 自定义登录页面
- c++ - 从线程接收结果
- c# - Windows 服务中的 C# GetAsyncKeyState
- python-3.x - TypeError: 输出数组 img 的布局与 cv::Mat 不兼容 (step[ndims-1] != elemsize or step[1] != elemsize*nchannels)
- h2 - H2 关于 URL 用户密码等的一些混淆和澄清,
- c# - 查找文件中最后一次出现的字符串