tfjs-core 引用突然停止工作并显示“在注册表中找不到后端".错误 [英] tfjs-core reference suddenly stop working and shows "No backend found in registry." error
问题描述
我正在处理一个涉及 Handpose 和 tensorflow 库的演示项目.一切正常,但现在没有对代码和环境进行任何更改,出现以下错误:
I'm working on a demo project involving Handpose and tensorflow libraries. Everything was working okay, but now, having done no changes to both the code nor the environment, the following error shows up:
Uncaught (in promise) Error: No backend found in registry.
at t.getSortedBackends (tfjs-core:17)
at t.initializeBackendsAndReturnBest (tfjs-core:17)
at t.get [as backend] (tfjs-core:17)
at t.makeTensor (tfjs-core:17)
at Xt (tfjs-core:17)
at Yt (tfjs-core:17)
at Object.eo [as decodeWeights] (tfjs-core:17)
at t.<anonymous> (tfjs-converter:17)
at tfjs-converter:17
at Object.next (tfjs-converter:17)
tfjs-core 引用存在于我的 index.html 文件中:
The tfjs-core reference exists within my index.html file:
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core"></script>
并在我的 main.js 文件中使用 handpose:
And use handpose in my main.js file:
const load_model = async () => {
const model = await handpose.load();
console.log("Model loaded");
model_label = document.getElementById("label");
model_label.innerText = "Model loaded... press start tracking:"
return model
}
我检查了 tfjs-core 存储库,没有新版本.我也尝试参考较旧的稳定版本,但仍然存在相同的问题.我不知道发生了什么.
I've checked the tfjs-core repository and there have been no new releases. I also tried to reference older stable version instead, but still having the same issue. I can't figure out what happened.
推荐答案
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-converter"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/handpose"></script>
Tensorflow 发布了 2.0.0,现在您必须选择 tfjs-backend-webgl、tfjs-backend-cpu 或 tfjs-backend-wasm 来运行您的模型.您正在使用 handpose,为此您应该使用 webgl.
Tensorflow released 2.0.0, and now you must choose either tfjs-backend-webgl, tfjs-backend-cpu, or tfjs-backend-wasm to run your model. You're using handpose and for that you should use webgl.
重复 handpose tfjs 错误 - 未找到后端在注册表中
这篇关于tfjs-core 引用突然停止工作并显示“在注册表中找不到后端".错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!