By using AWS re:Post, you agree to the Terms of Use

Questions tagged with Amazon SageMaker

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

How to use sagemaker-pyspark in batch inference

am trying to execute the code below ``` ENDPOINT_NAME = "my-endpoint" from sagemaker_pyspark import SageMakerModel from sagemaker_pyspark import EndpointCreationPolicy from sagemaker_pyspark.transformation.serializers import ProtobufRequestRowSerializer from sagemaker_pyspark.transformation.deserializers import ProtobufResponseRowDeserializer from pyspark.sql.types import StructType, StructField, MapType, StringType, IntegerType, ArrayType, FloatType attachedModel = SageMakerModel.fromEndpoint( endpointName = ENDPOINT_NAME, requestRowSerializer=ProtobufRequestRowSerializer( featuresColumnName = "col1" ), responseRowDeserializer=ProtobufResponseRowDeserializer(schema=StructType([ StructField('prediction', MapType(StringType(), FloatType())) ])) ) data=SageMakerModel.transform(attachedModel, df['col1']) ``` I keep getting the below error though ``` py4j.protocol.Py4JError: An error occurred while calling o58.__getstate__. Trace: py4j.Py4JException: Method __getstate__([]) does not exist at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:318) at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:326) at py4j.Gateway.invoke(Gateway.java:274) at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132) at py4j.commands.CallCommand.execute(CallCommand.java:79) at py4j.GatewayConnection.run(GatewayConnection.java:238) at java.lang.Thread.run(Thread.java:748) ``` any ideas ?
1
answers
0
votes
53
views
asked 24 days ago

SageMaker debugger built in rule CreateXgboostRule not generating report as expected

I'm currently working with a SageMaker hosted XGBoost model; I've added the built in rule "CreateXgboostRule" to generate a training report, however, only the ProfilerReport is generated in the S3 rule-output folder - the expected result based on the dev doc is for a CreateXGBoostRule folder as well within this same folder. The code I'm using is based directly on the example provided in: https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-training-xgboost-report.html ``` import boto3 import sagemaker from sagemaker.estimator import Estimator from sagemaker import image_uris from sagemaker.debugger import Rule, rule_configs rules=[ Rule.sagemaker(rule_configs.create_xgboost_report()) ] region = boto3.Session().region_name xgboost_container=sagemaker.image_uris.retrieve("xgboost", region, "1.2-1") estimator=Estimator( role=sagemaker.get_execution_role() image_uri=xgboost_container, base_job_name="debugger-xgboost-report-demo", instance_count=1, instance_type="ml.m5.2xlarge", # Add the Debugger XGBoost report rule rules=rules ) estimator.fit(wait=False) ``` I've tried rewriting the estimator a number of ways, verified "rules" is receiving an array of objects, tried different versions of XGBoost within the region, but everything still results in the built in rule only creating the ProfilerReport with no CreateXGBoostRule directory under rule-output. Any ideas would be greatly appreciated! Thanks.
1
answers
0
votes
33
views
asked a month ago