在将 aws-sdk 的比较面孔功能与 nodeJS 一起使用时,我们偶尔会看到此错误:
InvalidParameterException: Request has Invalid Parameters
at Request.extractError (/app/node_modules/aws-sdk/lib/protocol/json.js:48:27)
at Request.callListeners (/app/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/app/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/app/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/app/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/app/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /app/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/app/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/app/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/app/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
at Request.emit (/app/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/app/node_modules/aws-sdk/lib/request.js:683:14) at Request.transition (/app/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/app/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /app/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/app/node_modules/aws-sdk/lib/request.js:38:9)
message: 'Request has Invalid Parameters',
code: 'InvalidParameterException',
time: 2018-05-08T15:27:28.188Z,
requestId: 'XXXXX',
statusCode: 400,
retryable: false,
retryDelay: 52.72405778418885 }
每次使用 iPhone 相机拍摄图像,保存为 JPEG 格式并包含人脸。图像没有损坏,并且已经使用 jpeginfo 进行了测试。然后将它们转换为二进制并通过 sdk 发送到 rekognition。我们通过 python 库 Boto 运行了相同的图像,并成功收到了比较结果。
我们可以在节点端采取进一步的诊断步骤来帮助调试吗?或者对错误原因的任何见解?
更新:
图像尺寸:源:1189 × 750 目标:360 × 480