如何在 AWS sagemaker 中为 yolov5 推理创建端点
我已经训练了 yolov5 来检测自定义对象,现在我必须将其部署在 AWS sagemaker 上,因为我需要创建一个推理端点,我已经看过一些关于如何在 AWS 上创建端点的教程,但我没有知道如何为 yolov5 做这件事,有人可以帮助我吗?
I've trained yolov5 to detect a custom object, now I have to deploy it on AWS sagemaker, for that I need to create an endpoint for inference, I've seen some tutorials on how to create endpoints on AWS but I don't know how to do it for yolov5 , can someone help me please ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要在 SageMaker 上部署 yolov5 等模型,您需要构建自定义容器,这种方法称为自带容器 (BYOC)。您需要在 Dockerfile 上安装 yolov5 并在 Predictor.py 文件中采用您的推理代码。看一下下面使用 Spacy 库的示例,您可以模仿除 Dockerfile 和 Predictor.py 之外的所有内容,您需要调整安装和推理代码逻辑。
BYOC 示例: https://github.com /RamVegiraju/SageMaker-Deployment/tree/master/RealTime/BYOC/PreTrained-Examples/SpacyNER
要调整的文件: Dockerfile、预测器.py
To deploy a model such as yolov5 on SageMaker, you will need to build a custom container, this approach is known as Bring Your Own Container (BYOC). You will need to install yolov5 on the Dockerfile and adopt your inference code in the predictor.py file. Take a look at the following example with the library Spacy, you can mimic everything except the Dockerfile and predictor.py which you need to adjust for installation and your inference code logic.
BYOC Example: https://github.com/RamVegiraju/SageMaker-Deployment/tree/master/RealTime/BYOC/PreTrained-Examples/SpacyNER
Files To Adjust: Dockerfile , predictor.py