【问题标题】:Unable to use custom classifier in Node-Red Watson Visual Recognition node无法在 Node-Red Watson Visual Recognition 节点中使用自定义分类器
【发布时间】:2017-12-26 18:20:03
【问题描述】:

我有一个流程,用于从 IBM 对象存储中获取图像并将其传递到 Watson Visual Recognition 节点,以便使用我训练过的自定义分类器进行分类。几周前它停止工作,视觉识别节点会抛出一个错误,提示“收到的 JSON 参数无效。无法解析。”。我用“change”节点设置要分类的消息的参数如下图: 我注意到,如果删除设置分类器 ID 的节点,则不会出现错误,并且使用默认分类器对图像进行分类。我尝试使用函数节点使用以下代码设置参数,但我得到了同样的错误:

msg.params = {};
msg.params["detect_mode"] = "classify";
msg.params["classifier_ids"] = "person_705615375";
msg.params["threshold"] = 0;
return msg;

此外,如果我将分类器设置为“默认”,则应根据视觉识别节点的信息页面使用默认分类器对图像进行分类。但是我仍然遇到同样的错误。以下是为分类传递的消息示例:

视觉识别节点结果中的一些额外信息:

result: object
    error: object
        message: "Invalid JSON parameter received. Unable to parse."
        stack: "Error: Invalid JSON parameter received. Unable to parse.↵ at Request._callback (/home/vcap/app/node_modules/node-red-node-watson/node_modules/watson-developer-cloud/lib/requestwrapper.js:85:15)↵ at Request.self.callback (/home/vcap/app/node_modules/node-red-node-watson/node_modules/watson-developer-cloud/node_modules/request/request.js:186:22)↵ at emitTwo (events.js:87:13)↵ at Request.emit (events.js:172:7)↵ at Request.<anonymous> (/home/vcap/app/node_modules/node-red-node-watson/node_modules/watson-developer-cloud/node_modules/request/request.js:1163:10)↵ at emitOne (events.js:77:13)↵ at Request.emit (events.js:169:7)↵ at IncomingMessage.<anonymous> (/home/vcap/app/node_modules/node-red-node-watson/node_modules/watson-developer-cloud/node_modules/request/request.js:1085:12)↵ at IncomingMessage.g (events.js:260:16)↵ at emitNone (events.js:72:20)↵ at IncomingMessage.emit (events.js:166:7)↵ at endReadableNT (_stream_readable.js:923:12)↵ at nextTickC..."
        code: 400
        images_processed: 0
        error: "Invalid JSON parameter received. Unable to parse."
        description: "Invalid JSON parameter received. Unable to parse."
        error_id: "parameter_error"

【问题讨论】:

    标签: node-red watson visual-recognition


    【解决方案1】:

    我遇到了同样的错误。

    试试这个方法。 像这样重写函数节点:

    msg.params={"classifier_ids":["person_705615375"],"threshold":0};
    return msg;
    

    “detect_mode”可以在Visual Recognition节点中设置。

    【讨论】:

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