如何解决在Sagemaker端点上运行的Keras模型随机失败
我有一个在Sagemaker中运行的端点,该端点带有MLflow部署的Pyfunc模型,该模型加载Keras模型并对其进行预测。当在我的计算机上运行本地Sagemaker容器时(使用mlflow sagemaker run-local),端点正常运行不会出现问题。当我直接在Sagemaker上查询端点时,它也有效,但不一致。在大约1%的呼叫中,端点失败并显示以下错误:
Calling `Model.predict` in graph mode is not supported when the `Model` instance was constructed with eager mode enabled. Please construct your `Model` instance in graph mode or call `Model.predict` with eager mode enabled
在运行 model.predict 之前,我尝试设置 model.run_eagerly = True ,但是遇到了同样的错误。我正在使用Tensorflow 2(tf-nightly-20201028),我的理解是默认情况下运行eager模式,因此我不必使用图模式。是对的吗?无论如何,我不明白为什么端点在少数情况下会随机失败。
我发现了一个类似的问题,但这似乎特定于XGBoost库sagemaker endpoint invocation randomly throws error
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。