philschmid / huggingface-sagemaker-workshop-series

Enterprise Scale NLP with Hugging Face & SageMaker Workshop series

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ParameterString' object has no attribute 'decode'

vmunagal opened this issue · comments


AttributeError Traceback (most recent call last)
in
----> 1 pipeline.upsert(role_arn=role)

/opt/conda/lib/python3.7/site-packages/sagemaker/workflow/pipeline.py in upsert(self, role_arn, description, tags, parallelism_config)
275 raise ValueError("An AWS IAM role is required to create or update a Pipeline.")
276 try:
--> 277 response = self.create(role_arn, description, tags, parallelism_config)
278 except ClientError as ce:
279 error_code = ce.response["Error"]["Code"]

/opt/conda/lib/python3.7/site-packages/sagemaker/workflow/pipeline.py in create(self, role_arn, description, tags, parallelism_config)
144 tags = _append_project_tags(tags)
145 tags = self.sagemaker_session._append_sagemaker_config_tags(tags, PIPELINE_TAGS_PATH)
--> 146 kwargs = self._create_args(role_arn, description, parallelism_config)
147 update_args(
148 kwargs,

/opt/conda/lib/python3.7/site-packages/sagemaker/workflow/pipeline.py in _create_args(self, role_arn, description, parallelism_config)
166 A keyword argument dict for calling create_pipeline.
167 """
--> 168 pipeline_definition = self.definition()
169 kwargs = dict(
170 PipelineName=self.name,

/opt/conda/lib/python3.7/site-packages/sagemaker/workflow/pipeline.py in definition(self)
352 def definition(self) -> str:
353 """Converts a request structure to string representation for workflow service calls."""
--> 354 request_dict = self.to_request()
355 self._interpolate_step_collection_name_in_depends_on(request_dict["Steps"])
356 request_dict["PipelineExperimentConfig"] = interpolate(

/opt/conda/lib/python3.7/site-packages/sagemaker/workflow/pipeline.py in to_request(self)
105 if self.pipeline_experiment_config is not None
106 else None,
--> 107 "Steps": build_steps(self.steps, self.name),
108 }
109

/opt/conda/lib/python3.7/site-packages/sagemaker/workflow/utilities.py in build_steps(steps, pipeline_name)
98 pipeline_name, step.name, get_code_hash(step), get_config_hash(step)
99 ):
--> 100 request_dicts.append(step.to_request())
101 return request_dicts
102

/opt/conda/lib/python3.7/site-packages/sagemaker/workflow/steps.py in to_request(self)
506 def to_request(self) -> RequestType:
507 """Updates the request dictionary with cache configuration."""
--> 508 request_dict = super().to_request()
509 if self.cache_config:
510 request_dict.update(self.cache_config.config)

/opt/conda/lib/python3.7/site-packages/sagemaker/workflow/steps.py in to_request(self)
350 def to_request(self) -> RequestType:
351 """Gets the request structure for ConfigurableRetryStep."""
--> 352 step_dict = super().to_request()
353 if self.retry_policies:
354 step_dict["RetryPolicies"] = self._resolve_retry_policy(self.retry_policies)

/opt/conda/lib/python3.7/site-packages/sagemaker/workflow/steps.py in to_request(self)
119 "Name": self.name,
120 "Type": self.step_type.value,
--> 121 "Arguments": self.arguments,
122 }
123 if self.depends_on:

/opt/conda/lib/python3.7/site-packages/sagemaker/workflow/steps.py in arguments(self)
485 request_dict = estimator.sagemaker_session.context.args
486 else:
--> 487 self.estimator._prepare_for_training(self.job_name)
488 train_args = _TrainingJob._get_train_args(
489 self.estimator, self.inputs, experiment_config=dict()

/opt/conda/lib/python3.7/site-packages/sagemaker/estimator.py in _prepare_for_training(self, job_name)
3178 constructor if applicable.
3179 """
-> 3180 super(Framework, self)._prepare_for_training(job_name=job_name)
3181
3182 self._validate_and_set_debugger_configs()

/opt/conda/lib/python3.7/site-packages/sagemaker/estimator.py in _prepare_for_training(self, job_name)
767 constructor if applicable.
768 """
--> 769 self._current_job_name = self._get_or_create_name(job_name)
770
771 # if output_path was specified we use it otherwise initialize here.

/opt/conda/lib/python3.7/site-packages/sagemaker/estimator.py in _get_or_create_name(self, name)
741 return name
742
--> 743 self._ensure_base_job_name()
744 return name_from_base(self.base_job_name)
745

/opt/conda/lib/python3.7/site-packages/sagemaker/estimator.py in _ensure_base_job_name(self)
722 self.base_job_name = (
723 self.base_job_name
--> 724 or get_jumpstart_base_name_if_jumpstart_model(self.source_dir, self.model_uri)
725 or base_name_from_image(
726 self.training_image_uri(), default_base_name=EstimatorBase.JOB_CLASS_NAME

/opt/conda/lib/python3.7/site-packages/sagemaker/jumpstart/utils.py in get_jumpstart_base_name_if_jumpstart_model(*uris)
255 """
256 for uri in uris:
--> 257 if is_jumpstart_model_uri(uri):
258 return constants.JUMPSTART_RESOURCE_BASE_NAME
259 return None

/opt/conda/lib/python3.7/site-packages/sagemaker/jumpstart/utils.py in is_jumpstart_model_uri(uri)
181
182 bucket = None
--> 183 if urlparse(uri).scheme == "s3":
184 bucket, _ = parse_s3_url(uri)
185

/opt/conda/lib/python3.7/urllib/parse.py in urlparse(url, scheme, allow_fragments)
365 Note that we don't break the components up in smaller bits
366 (e.g. netloc is a single string) and we don't expand % escapes."""
--> 367 url, scheme, _coerce_result = _coerce_args(url, scheme)
368 splitresult = urlsplit(url, scheme, allow_fragments)
369 scheme, netloc, url, query, fragment = splitresult

/opt/conda/lib/python3.7/urllib/parse.py in _coerce_args(*args)
121 if str_input:
122 return args + (_noop,)
--> 123 return _decode_args(args) + (_encode_result,)
124
125 # Result objects are more helpful than simple tuples

/opt/conda/lib/python3.7/urllib/parse.py in _decode_args(args, encoding, errors)
105 def _decode_args(args, encoding=_implicit_encoding,
106 errors=_implicit_errors):
--> 107 return tuple(x.decode(encoding, errors) if x else '' for x in args)
108
109 def _coerce_args(*args):

/opt/conda/lib/python3.7/urllib/parse.py in (.0)
105 def _decode_args(args, encoding=_implicit_encoding,
106 errors=_implicit_errors):
--> 107 return tuple(x.decode(encoding, errors) if x else '' for x in args)
108
109 def _coerce_args(*args):

AttributeError: 'ParameterString' object has no attribute 'decode'

Did you run the exact same code?