如何验证 sagemaker 中是否安装了所有依赖项?
我正在创建一个 sagemaker 端点并从 s3 存储桶加载预训练模型。模型 -> model.tar.gz 文件具有此处记录的目录结构, https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#model-directory-struct
model.tar.gz/
|- model.pth
|- code/
|- inference.py
|- requirements.txt # only for versions 1.3.1 and higher
我放置了一些依赖项在requirements.txt中,有没有办法验证所有依赖项是否已正确安装?
I am creating an sagemaker endpoint and loading a pretrained model from an s3 bucket. the model -> model.tar.gz file has directory structure as documented here, https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#model-directory-structure
model.tar.gz/
|- model.pth
|- code/
|- inference.py
|- requirements.txt # only for versions 1.3.1 and higher
I have put few dependencies in requirements.txt, is there a way to verify that all the dependencies were installed correctly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于 SageMaker 的部署是无服务器的,因此无法访问或通过 SSH 访问正在运行部署的计算机。因此,一种方法是通过执行如下操作来断言“inference.py”内的 model_fn 中的依赖项版本。
如果您的requirements.txt如下所示:
获取版本并在`model_fn中断言它们,如下所示:
Since SageMaker's deployments are serverless, it is not possible to get access or SSH into the machine that's running your deployment. So, one way is to assert the versions of your dependencies in the
model_fn
inside "inference.py" by doing something like below.if your requirements.txt looks like this:
get the versions and assert them in `model_fn like below: