AWSSageMaker管道问题-管道变量不支持__str__操作
创始人
2024-09-27 01:30:30
0

该错误通常是因为在定义SageMaker管道时使用了Python类型的变量而不是序列化后的变量。为解决此问题,请使用SageMaker的DefaultSerializer序列化您的变量。以下是一个示例:

from sagemaker.workflow.parameters import ( ParameterInteger, ParameterString, )

from sagemaker.workflow.pipeline import Pipeline from sagemaker.workflow.steps import ( CacheConfig, Step, ) from sagemaker.workflow.step_collections import RegisterModel

from sagemaker.tensorflow.estimator import TensorFlow

bucket = ParameterString( name='BucketName', default_value='my-bucket' )

training_input_path = ParameterString( name='TrainingInputPath', default_value=f's3://{bucket}/mnist' )

model_approval_status = ParameterString( name='ModelApprovalStatus', default_value='PendingManualApproval' )

train_instance_count = ParameterInteger( name='TrainingInstanceCount', default_value=1 )

train_instance_type = ParameterString( name='TrainingInstanceType', default_value='ml.c4.xlarge' )

tf_estimator = TensorFlow(entry_point='mnist.py', role='SageMakerRole', train_instance_count=train_instance_count, train_instance_type=train_instance_type, sagemaker_session=sagemaker_session)

step_train = Step( name='Train', inputs={ 'training': training_input_path, }, outputs={ 'model': 's3://BUCKET/training/job/model.tar.gz', }, cache_config=CacheConfig(enabled=True, expire_after='7d'), estimator=tf_estimator )

model = RegisterModel( name='MyModel', estimator=tf_estimator, image_uri=tf_estimator.training_image_uri(), content_types=['text/csv', 'application/json'], response_types=['text/csv'], inference_instances=[train_instance_type], transform_instances=[train_instance_type], model_package_group_name='MyPackageGroup', approval_status=model_approval_status, )

pipe = Pipeline( name='TrainingPipe', parameters=[bucket, training_input_path, model_approval_status, train_instance_count, train_instance_type], steps=[step_train, model])

serialized

相关内容

热门资讯

透视插件!wpk透视表,大唐辅... 透视插件!wpk透视表,大唐辅助软件,解密教程(有挂攻略);《WPK辅助透视》‌:支持手机实时对战,...
辅助透视!智星德州菠萝插件官网... 辅助透视!智星德州菠萝插件官网,禅游指尖四川无限钻石,必胜教程(有挂透视);1分钟了解详细教程(微信...
透视计算!德普之星app安卓版... 透视计算!德普之星app安卓版破解版,花花生活圈脚本,科技教程(有挂神器);1.花花生活圈脚本 ai...
透视ai代打!红龙poker透... 自定义新九方科技系统规律,只需要输入自己想要的开挂功能,一键便可以生成出微扑克专用辅助器,不管你是想...
透视app!wepoker透视... 透视app!wepoker透视脚本苹果版,熊猫辅助软件,系统教程(有挂方法);原来确实真的有挂(需添...
透视好友!红龙poker作弊指... 透视好友!红龙poker作弊指令,福建兄弟13水修改器,教你教程(有挂辅助)是一款可以让一直输的玩家...
透视数据!wepoker底牌透... 1、透视数据!wepoker底牌透视脚本http,约局吧可以看到别人的底牌,解密教程(有挂教程)2、...
透视ai代打!aapoker俱... 透视ai代打!aapoker俱乐部靠谱吗,哈灵脚本辅助最简单三个步骤,细节揭秘(有挂辅助)1、很好的...
透视黑科技!aapoker辅助... 透视黑科技!aapoker辅助包,新九方科技,解密教程(有挂教程)是由北京得新九方科技黑科技有限公司...
透视规律!德普之星透视辅助io... 透视规律!德普之星透视辅助ios,四川徒有辅助软件,微扑克教程(有挂神器);建议优先通过四川徒有辅助...