Pytorch模型部署到SageMaker
我已经培训了Yolov5型号,并具有权重。 我正在关注此Tutoriel 由于我正在使用图像工作,因此我试图自定义Input_FN,output_fn功能,但是不幸的是,当我运行推理时,我总是会遇到错误,我的问题是我应该遵循什么逻辑来自定义这些功能?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些功能中的每一个都有不同的目的。使用Input_FN,您需要准备模型期望的输入。使用Model_FN,您需要加载Pytorch型号。使用预测_FN,您需要具有预测/推理功能代码。使用output_fn可以塑造从端点返回的输出。请查看本文,以便更深入地了解这些处理程序以及示例: https://aws.plainenglish.io/adding-custom-inferem-inference-scripts-to-amazon-sagemaker-2208c3332510
Each of these functions have a different purpose. Using the input_fn you want to prepare your input for what your model is expecting. Using the model_fn you want to load up your pytorch model. Using the predict_fn you want to have your predict/inference function code. Using output_fn you can shape the output that you return from your endpoint. Check out this article for an understanding of each of these handlers more in depth as well as examples: https://aws.plainenglish.io/adding-custom-inference-scripts-to-amazon-sagemaker-2208c3332510