赞
踩
未在注册表中找到后端?但是我已经在package.json中以及安装了相关依赖
"dependencies": {
"@tensorflow/tfjs-backend-cpu": "^3.13.0",
"@tensorflow/tfjs-backend-webgl": "^3.13.0",
"@tensorflow/tfjs-converter": "^3.13.0",
"@tensorflow/tfjs-core": "^3.13.0",
"crypto-js": "^4.1.1",
"fetch-wechat": "^0.0.3"
}
解决方案:在 模型进行预测的js文件 中加上
require("@tensorflow/tfjs-backend-webgl")
require("@tensorflow/tfjs-backend-cpu")
成功解决!
插件未注册错误? 但是我已经注册了插件并且添加了appID
"plugins": {
"tfjsPlugin": {
"version": "0.1.0",
"provider": "wx5b446950d438663b "
}
},
解决方案:经过尝试,在微信开发者工具重新扫码登陆可以解决
npm init -y
npm install @tensorflow/tfjs-core
npm install @tensorflow/tfjs-converter
npm install fetch-wechat
npm install @tensorflow/tfjs-backend-webgl
npm install @tensorflow/tfjs-backend-cpu
npm install crypto-js (用于解决找不到crpyto.js 错误)
var fetchWechat = require('fetch-wechat'); var tf = require('@tensorflow/tfjs-core'); var plugin = requirePlugin('tfjsPlugin'); require("@tensorflow/tfjs-backend-webgl") require("@tensorflow/tfjs-backend-cpu") // app.js App({ onLaunch() { plugin.configPlugin({ // polyfill fetch function fetchFunc: fetchWechat.fetchFunc(), // inject tfjs runtime tf, // provide webgl canvas canvas: wx.createOffscreenCanvas() }); console.log('on launch') tf.tensor([1, 2, 3, 4]).print() })
"plugins": {
"tfjsPlugin": {
"version": "0.1.0",
"provider": "wx5b446950d438663b "
}
},
"plugins": {
"tfjsPlugin": {
"version": "0.0.6",
"provider": "wx6afed118d9e81df9"
}
}
修改version版本为0.1.0即可解决
有可能是动态壁纸的问题,笔者这边关闭之后会好很多。。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。