Git Product home page Git Product logo

garbage's Issues

你好 刚才使用了一下您的小程序,很棒,想请教两个问题

1.首先是训练集的问题,这些训练图片要在哪里找到
2.第二点是训练出来的模型要怎么做成小程序,这个问题确实有些大而泛了,就是希望大佬能指出一个方向。
软件大二学生,刚接触深度学习,目前水平只能做到数据增强和用VGG16等模型预训练然后全连接分类

请教一下域名设置的问题

出现了这个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

请问该怎么解决?项目设置中的 域名该如何设置啊。。。。。。

云函数调用失败

配置了云函数和百度云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

Debug 截图
img

非常感谢您的帮助!!!

代码书写问题

原代码:

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;
  });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.