【问题标题】:AWS Lambda Function Exiting Execution ImproperlyAWS Lambda 函数不正确地退出执行
【发布时间】:2020-12-19 04:56:04
【问题描述】:

我有 Lambda 函数试图从 TensorflowJS 运行 PoseNet。程序正确执行,直到到达

    const net = await posenet.load({
      architecture: 'MobileNetV1',
      inputResolution: { width: 183, height: 275 },
      scale: 0.8,
    })

在这一行之后,我有一个函数detect(net, image),它在内部获取输入图像并执行const pose = await net.estimateSinglePose(image),它应该只返回一个包含模型结果的 JSON 对象。但是,程序跳过了这个detect() 函数并成功完成了Lambda 执行。这是为什么呢?

【问题讨论】:

    标签: tensorflow aws-lambda


    【解决方案1】:

    检测是异步的,所以你必须await detect(....)

    或者使用 then

    detect(img).then(predictions => {
          console.log('Predictions: ', predictions);
        });
    

    【讨论】:

    • 我相信问题出在posenet.load()位
    猜你喜欢
    • 2016-10-16
    • 1970-01-01
    • 2023-01-22
    • 1970-01-01
    • 1970-01-01
    • 2017-09-05
    • 2020-11-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多