qi19901212 / garbage Goto Github PK
View Code? Open in Web Editor NEW小程序云开发的垃圾分类小程序
License: GNU General Public License v3.0
小程序云开发的垃圾分类小程序
License: GNU General Public License v3.0
配置了云函数和百度云Key。
Debug的时候出现 云函数调用失败,能指点一下吗?
返回结果
{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Cannot find module 'request-promise'"}
日志
START RequestId: 6381ac59-aa29-11e9-a24c-525400b2c41b
Event RequestId: 6381ac59-aa29-11e9-a24c-525400b2c41b
END RequestId: 6381ac59-aa29-11e9-a24c-525400b2c41b
Report RequestId: 6381ac59-aa29-11e9-a24c-525400b2c41b Duration:0ms Memory:256MB MaxMemoryUsed:241.628906MB
非常感谢您的帮助!!!
出现了这个bug:
Error: getaddrinfo ENOTFOUND api.baidubce.com api.baidubce.com:443
域名无法解析:➜ nslookup api.baidubce.com
Server: 10.11.56.23
Address: 10.11.56.23#53
** server can't find api.baidubce.com: NXDOMAIN
请问该怎么解决?项目设置中的 域名该如何设置啊。。。。。。
1.首先是训练集的问题,这些训练图片要在哪里找到
2.第二点是训练出来的模型要怎么做成小程序,这个问题确实有些大而泛了,就是希望大佬能指出一个方向。
软件大二学生,刚接触深度学习,目前水平只能做到数据增强和用VGG16等模型预训练然后全连接分类
根据网络接口查询,砖头为干垃圾,诶,分不清了都
原代码:
const rq = require('request-promise')
//
/**
* 获取百度ai AccessToken
*/
exports.main = async(event, context) => {
let clientId = '',
grantType = 'client_credentials',
clientSecret = '',
url = `https://aip.baidubce.com/oauth/2.0/token`
return new Promise(async(resolve, reject) => {
try {
let data = await rq({
method: 'POST',
url,
form: {
"grant_type": grantType,
"client_secret": clientSecret,
"client_id": clientId
},
json: true
})
resolve({
code: 0,
data,
info: '操作成功!'
})
} catch (error) {
console.log(error)
if (!error.code) reject(error)
resolve(error)
}
})
}
存在问题:
request-promise
看名字就知道是一个返回promise的请求库.为什么还要自己return
new Promise(async(resolve, reject) => {})
一个呢 这样写给人感觉很不好
. 同时谢谢作者的开源精神.
// 修改成这样,看起来就舒服多了
return rq({
method: 'POST',
url,
form: {
grant_type: grantType,
client_secret: clientSecret,
client_id: clientId
},
json: true
})
.then(data => ({
code: 0,
data,
info: '操作成功!'
}))
.catch(error => {
console.log(error);
if (!error.code) {
return Promise.reject(error);
}
return error;
});
违规了,打不开了。你的小程序。
萌新,已导入了sort跟product两个集合,是我操作的姿势不对么,求解
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.