标签: glitch-framework

TensorflowJS TFJS 错误:dict 的 dtype

曾尝试运行https://glitch.com/~tar-understood-exoplanet 并且模型无法加载,我将无法使用启用网络摄像头。

有人遇到过同样的问题吗?

当程序运行时,在控制台中我得到以下信息:

tfjs:2 Uncaught (in promise) Error: The dtype of dict['image_tensor'] provided in model.execute(dict) must be int32, but was float32
    at Object.b [as assert] (tfjs:2)
    at tfjs:2
    at Array.forEach (<anonymous>)
    at t.checkInputShapeAndType (tfjs:2)
    at t.<anonymous> (tfjs:2)
    at tfjs:2
    at Object.next (tfjs:2)
    at tfjs:2
    at new Promise (<anonymous>)
    at Zv (tfjs:2)
Run Code Online (Sandbox Code Playgroud)

我有一台 Macbook Pro,Windows 上的其他一些人在运行该模型时也遇到了一些问题。我们还在不同的浏览器上进行了尝试,Safari 和 Chrome。

成功!切换到 coco-ssd 2.0.2 后:

我在第 62 行添加了 2.0.2 版本,如下所示:

<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/coco-ssd@2.0.2"></script>
Run Code Online (Sandbox Code Playgroud)

machine-learning tensorflow.js glitch-framework

6
推荐指数
1
解决办法
952
查看次数