问题描述
我在运行用于 Google AutoML 多对象检测的脚本时遇到了标题错误。有什么线索吗?
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-automl"></script>
<img id="mahjong" src="tiles2.jpg">
<script>
async function run() {
const model = await tf.automl.loadobjectDetection('model.json');
const image = document.getElementById('mahjong');
const options = {score: 0.5,IoU: 0.5,topk: 20};
const predictions = await model.detect(image,options);
console.log(predictions);
// Show the resulting object on the page.
const pre = document.createElement('pre');
pre.textContent = JSON.stringify(predictions,null,2);
document.body.append(pre);
}
run();
</script>
未捕获(承诺)错误:model.execute(dict) 中提供的 dict 有键:[ToFloat] 不是图的一部分 在 e.t.checkInputs (tfjs:17) 吃。 (tfjs:17) 在你 (tfjs:17) 在 Generator._invoke (tfjs:17) 在 Generator.forEach.e. [作为下一个] (tfjs:17) 在 嗯 (tfjs:17) 在 o (tfjs:17) 在 tfjs:17 在新的承诺 () 吃。 (tfjs:17)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)