【问题标题】:Error 429 - too much requests - trying to delete all classifiers of IBM Watson Visual Recognition service错误 429 - 请求过多 - 试图删除 IBM Watson Visual Recognition 服务的所有分类器
【发布时间】:2016-06-07 21:58:21
【问题描述】:

我正在尝试删除我的 IBM Watson Visual Recognition 服务实例的所有分类器,以便我只能创建用于我的应用程序的新分类器。

为此,我编写了列出所有分类器并发送删除请求的 Node.js 代码。

当我执行它(数百个并行删除请求)时,我收到了429 error - too many requests。之后,我所有的删除请求(甚至是个别的)都收到了404 error - Cannot delete classifier。

我的问题是:

  1. 有没有更好的方法来删除所有没有做的分类器?
  2. 为什么我现在无法删除单个分类器?在出现 429 too many requests 错误后,是否有某些政策阻止了我?

这是我在多次删除请求中收到的 429 错误

code: 429,
  error: '<HTML><BODY><span class=\'networkMessage\'><h2>Wow, is it HOT in here!</h2>My CPU cores are practically burning up thanks to all the great questions from wonderful humans like you.<p>Popularity has its costs however. Right now I just can\'t quite keep up with everything. So I ask your patience while my human subsystems analyze this load spike to get me more Power.<p>I particularly want to <b>thank you</b> for bringing your questions. PLEASE COME BACK - soon and frequently! Not only do I learn from your usage, but my humans learn from workload spikes (like this one) how to better adjust capacity with Power and Elastic Storage.<p>So again, thank you for helping to make me smarter and better. I\'m still young and growing, but with your patience and help, I hope to make you proud someday!</p>Your buddy,<br>Watson<br><span class=\'watsonIcon\'></span>p.s. Please share your experiences in the Watson C

编辑:

我注意到该错误显然仅在我尝试删除服务提供的“默认”分类器(如“图形”、“颜色”、“黑白”等)时发生。当我尝试删除使用自己的图片创建的分类器时,删除工作正常。

我不允许删除默认分类器是服务的特征吗?如果是,有什么特殊原因吗?我正在构建的应用程序不需要所有这些内置分类器,因此拥有所有这些是没有用的。

我知道,当我请求新分类时,我可以通知我想使用的分类器列表,但在这种情况下,我需要保留一个单独的分类器列表,并且无法请求更多没有在结果中获取默认分类器的通用分类。

我正在使用节点 js 模块 "watson-developer-cloud": "^1.3.1" - 我不确定它在内部使用了哪些 API 版本。我刚刚注意到有一个更新的版本可用。如果有任何不同,我会更新并在这里报告。

这是我用来删除单个分类器的 JS 函数

function deleteClassifier(classifier_id,callback){
    var data = {
      "classifier_id": classifier_id,
    };
    visualRecognition.deleteClassifier(data,function(err, response) {
      if (err){
        callback(err);
      }
      else{
        callback(null, response);
      }
    });
  }

-编辑

在我使用 V2 API 时发生 - 但我相信它与 API 版本无关。查看接受的答案

【问题讨论】:

    标签: node.js ibm-cloud ibm-watson visual-recognition


    【解决方案1】:

    1-有没有更好的方法来删除所有不做的分类器?

    不行,你必须一一删除。

    2- 为什么我现在无法删除单个分类器?在 429 太多请求后,是否有一些政策阻止我?

    我怀疑当您对 DELETE /classifiers/{classifier_id} 的请求返回 404 时,这是因为之前已成功删除了 classifier_id。您可以通过执行 GET /classifiers 操作来验证这一点,以查看您帐户的所有当前自定义分类器的列表。 404 是对尝试删除无法找到的分类器的设计响应(如果之前已将其删除,则会出现这种情况。)在遇到 429 后没有任何策略会阻止您。

    您能否举例说明您正在使用的网址 - 我很好奇它是 beta 服务 (v2) 还是最新版本 v3?

    【讨论】:

      【解决方案2】:

      我发现问题是我试图删除默认分类器,这是不允许的。

      在更高版本的 API(我写这个答案时是 V3)只有一个默认分类器,它不能被删除。

      我得到的 404 错误是因为我试图删除默认分类器。正如 Matt Hill 在他的回答中提到的那样,我所有的自定义分类器都已被删除

      【讨论】:

        猜你喜欢
        • 2018-06-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-09-23
        • 2017-05-22
        • 1970-01-01
        • 2020-05-26
        • 1970-01-01
        相关资源
        最近更新 更多