createInferenceSession(modelPath) { return new Promise((resolve, reject) => { this.session = wx.createInferenceSession({ model: modelPath, /* 0: Lowest precision e.g., LS16 + A16 + Winograd A16 + approx. math 1: Lower precision e.g., LS16 + A16 + Winograd off + approx. math 2: Modest precision e.g., LS16 + A32 + Winograd A32 + approx. math 3: Higher precision e.g., LS32 + A32 + Winograd A32 + approx. math 4: Highest precision e.g., LS32 + A32 + Winograd A32 + precise math Higher precision always require longer time to run session */ precisionLevel : 0, allowNPU : false, // wheather use NPU for inference, only useful for IOS allowQuantize: false, // wheather generate quantize model }); // 监听error事件 this.session.onError((error) => { console.log("onError") console.error(error); reject(error); }); this.session.onLoad(() => {console.log("onload") this.ready = true; resolve(); }); this.session.offError(()=>{ console.log("offErr") }); this.session.offLoad(()=>{ console.log("offLoad") }); // wx.getFileSystemManager().access({ // path: modelPath, // success: (res) => // { // console.log("test succ") // }, // fail:(res)=>{ // console.log("test err") // } // }) }) }
和体验版不同https://developers.weixin.qq.com/miniprogram/dev/devtools/remote-debug-2.html 真机调试下 wx.createInferenceSession 可以正确执行 session.onLoad方法,可是在体验版下无法执行session.onLoad,哪个是正常的呢?
07-15createInferenceSession(modelPath) { return new Promise((resolve, reject) => { this.session = wx.createInferenceSession({ model: modelPath, /* 0: Lowest precision e.g., LS16 + A16 + Winograd A16 + approx. math 1: Lower precision e.g., LS16 + A16 + Winograd off + approx. math 2: Modest precision e.g., LS16 + A32 + Winograd A32 + approx. math 3: Higher precision e.g., LS32 + A32 + Winograd A32 + approx. math 4: Highest precision e.g., LS32 + A32 + Winograd A32 + precise math Higher precision always require longer time to run session */ precisionLevel : 0, allowNPU : false, // wheather use NPU for inference, only useful for IOS allowQuantize: false, // wheather generate quantize model }); // 监听error事件 this.session.onError((error) => { console.log("onError") console.error(error); reject(error); }); this.session.onLoad(() => { console.log("onload") this.ready = true; resolve(); }); this.session.offError(()=>{ console.log("offErr") }); this.session.offLoad(()=>{ console.log("offLoad") }); }) } 真机调试可以执行到onLoad,体验版和线上都无法执行
这个onLoad方法执行不了https://developers.weixin.qq.com/minigame/dev/api/ai/inference/InferenceSession.onLoad.html
07-15自己顶
ai推理的项目中wx.createInferenceSession onLoad无法加载?在 ai/mobilenet/index 那个官方项目中,classify.js中的推理函数 createInferenceSession方法中 的 this.session.onLoad(() => { this.ready = true; resolve(); }); 这个onLoad方法只有在 真机调试 中可以正常调用,在开发模式,体验模式,线上模式都无法正常加载(并不报错)
07-13真机调试可以,体验版即不执行也不报错 this.createInferenceSession(modelPath).then(() => {console.log("张小龙"); resolve(); })
小程序wx.createInferenceSession能用吗?InferenceSession wx.createInferenceSession(Object object)这个使用onnx模型推理接口还能使用吗,为什么我点不进去,而且编译显示wx.createInferenceSession not found
07-12安卓平台也不行啊 this.createInferenceSession(modelPath).then(() => { resolve(); })
Promise在微信7.0.x版本 调用 resolve ,不触发thenPromise在微信 7.0.x版本,IOS平台下,resolve 以后,在then中无法回调。 这个问题都谁遇到了?
07-11this.createInferenceSession(modelPath).then
调用wx.createInferenceSession真机上不能用?一直报错调用wx.createInferenceSession,真机上运行报错,报错提示: SystemError (appServiceSDKScriptError) Cannot read properties of undefined (reading 'CreateAsync') TypeError: Cannot read properties of undefined (reading 'CreateAsync') 开发工具上加载正常,真机就报错,更换过很多onnx模型都不行,模型上传到云,然后下载本地创建还是报错,到底是啥问题? 微信版本8.0.49
07-11找到客服 [图片] 然后就没有然后了
腾讯AI开放平台API调用问题?我这边是用JAVA的服务端做的请求 https://api.ai.qq.com/fcgi-bin/face/face_getinfo String line = "https://api.ai.qq.com/fcgi-bin/face/face_getinfo?"+params; URL url = new URL(line); URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); Scanner sc = new Scanner(is,"UTF-8"); 返回的是 { "ret": -31, "msg": "system busy, please try again later", "data": { "person_id": "", "person_name": "", "tag": "", "face_ids": [ ], "group_ids": [ ] } }
2020-02-28我这边是用JAVA的服务端做的请求 https://api.ai.qq.com/fcgi-bin/face/face_getinfo String line = "https://api.ai.qq.com/fcgi-bin/face/face_getinfo?"+params; URL url = new URL(line); URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); Scanner sc = new Scanner(is,"UTF-8"); 返回的是 { "ret": -31, "msg": "system busy, please try again later", "data": { "person_id": "", "person_name": "", "tag": "", "face_ids": [ ], "group_ids": [ ] } }
微信小程序调用腾讯AI返回小于0?[图片] 下午和晚上调用腾讯AI时都返回这样的错误,是腾讯AI接口问题还是我自己的代码或者网络问题
2020-02-28var colorStr = "b788ad"; console.log(6 - colorStr) colorStr = "#" + "000000".substring(0, 6 - colorStr) + colorStr; console.log(colorStr) 执行结果: [图片]
关于substring?function(){ colorStr = "b788ad"; return "#" + "000000".substring(0, 6 - colorStr)+colorStr; } 返回执行结果是 #b788ad,其中 6 - colorStr 不知道是什么意思,等待解答
2019-09-07