无法在 Node-Red Watson Visual Recognition 节点中使用自定义分类器

Unable to use custom classifier in Node-Red Watson Visual Recognition node

我有一个流程,我用它从 IBM 对象存储中获取图像并将其传递到 Watson Visual Recognition 节点,以便使用我训练过的自定义分类器进行分类。几周前它停止工作,视觉识别节点会抛出一个错误 "Invalid JSON parameter received. Unable to parse."。我使用 "change" 个节点来设置要分类的消息的参数,如下所示: 我注意到,如果删除设置分类器 ID 的节点,则不会出现任何错误,并且使用默认分类器对图像进行分类。我尝试使用功能节点使用以下代码设置参数,但我得到了同样的错误:

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

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

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

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"

我遇到了同样的错误。

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

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

"detect_mode"可以在视觉识别节点中设置。