在学习如何将tensorflow与微信小程序结合,做微信小程序与tensorflow.js准备工作时,出了点问题。
当时参考的教程(感觉十分详细):
开发|微信小程序与tensorflow.js准备工作
/article/9800104/
错误:
使用tensorflowJS插件出错:
thirdScriptError
Plugin "tfjsPlugin" has not registered.
Error: Plugin "tfjsPlugin" has not registered.
at t.getSchemaFromConfig (http://127.0.0.1:50939/appservice/__dev__/WAService.js:2:1784199)
at t.requirePlugin (http://127.0.0.1:50939/appservice/__dev__/WAService.js:2:1786323)
at http://127.0.0.1:50939/appservice/app.js:5:14
at require (http://127.0.0.1:50939/appservice/__dev__/WAService.js:2:1788795)
at <anonymous>:1:1
at HTMLScriptElement.scriptLoaded (http://127.0.0.1:50939/appservice/appservice?t=1589422064194:1116:21)
at HTMLScriptElement.script.onload (http://127.0.0.1:50939/appservice/appservice?t=1589422064194:1128:20)
解决:
发现是app.json与app.js中的Plugin名称不一致。
如图:我将app.js中的 tfjsPlugin 改为myPlugin ,即可正常运行。(当然也可将app.json中的 myPlugin 改为tfjsPlugin)
将tensorflow与微信小程序结合 微信开发者工具使用tensorflowJS插件出错:Error: Plugin tfjsPlugin has not registered.