AWS SageMaker-在本地培训,但要部署到AWS? [英] AWS SageMaker - training locally but deploying to AWS?

查看:128
本文介绍了AWS SageMaker-在本地培训,但要部署到AWS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用SageMaker时面临以下挑战:

I have a the following challenge with SageMaker:

  • I've downloaded one of the tutorial notebooks (https://github.com/awslabs/amazon-sagemaker-examples/blob/master/sagemaker-python-sdk/tensorflow_abalone_age_predictor_using_keras/tensorflow_abalone_age_predictor_using_keras.ipynb)
  • I ran the training locally (successfully) with the modifying the following line:

abalone_estimator = TensorFlow(entry_point='abalone.py',
                       role=role,
                       training_steps= 100,
                       evaluation_steps= 100,                                 
                       hyperparameters={'learning_rate': 0.001},
                       train_instance_count=1,
                       **train_instance_type='local'**)

abalone_estimator.fit(inputs)

  • 然后我想用下面的代码行将模型部署到AWS,但似乎SDK在本地部署了(它不会失败,我只是看到它在我的机器上运行)

  • I then wanted to deploy my model to AWS with the following line but it seems the SDK deploys it locally (it doesn't fail, I just see it running on my machine)

    abalone_predictor = abalone_estimator.deploy(initial_instance_count=1, instance_type='ml.m4.xlarge')

    关于如何修复它以便将其部署到AWS或重新加载我的训练模型并将其从头部署到AWS的任何技巧?

    Any tips on how to either fix it so it gets deployed to AWS or alternatively re-load my training model and deploy it to AWS from scratch?

    非常感谢, 斯蒂芬

    推荐答案

    在SageMaker上再次运行培训更加容易. 否则,这是您必须执行的步骤.

    Its easier to run the training again on SageMaker. Otherwise, here are the steps that you would have to do.

    1. 获取训练期间生成的检查点文件并将其转换为tensorflow服务模型.
    2. 以特定格式压缩它们并上传到S3
    3. 然后像上面一样创建估算器并进行推断.

    如果您想了解上述每个特定步骤的详细信息,请告诉我,但是如果您的数据集不太大,我想说的就是对SageMaker进行重新培训.

    If you want details on each of the specific steps above do let me know, but if your dataset is not too big, I would say just retrain on SageMaker.

    这篇关于AWS SageMaker-在本地培训,但要部署到AWS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆