Google has answers for SageMaker Studio, but I am at a loss for an answer on SageMaker Studio LAB...
I am reading the following on XGBoost - Am I in the right place for SM Studio LAB?
https://docs.aws.amazon.com/sagemaker/latest/dg/xgboost.html
Is there a better way for me to use XGBoost in LAB, vs what I am doing below by reading the doc above?
In SageMaker Studio I would do the following to get the ECR container for the XGBoost algorithm:
from sagemaker import image_uris
container = image_uris.retrieve('xgboost', boto3.Session().region_name, '1')
I made it a bit farther using the github example:
https://github.com/aws/studio-lab-examples/blob/main/connect-to-aws/Access_AWS_from_Studio_Lab.ipynb
This works:
from sagemaker import image_uris
from sagemaker.xgboost import XGBoost
# Create a training job name
job_name = 'ufo-xgboost-job-{}'.format(datetime.now().strftime("%Y%m%d%H%M%S"))
print('Here is the job name {}'.format(job_name))
import sagemaker
import boto3
from sagemaker import image_uris
from sagemaker.session import Session
from sagemaker.inputs import TrainingInput
But this is giving me trouble:
sess = sagemaker.Session()
xgb = sagemaker.estimator.Estimator(container,
role,
instance_count=1,
instance_type='ml.m4.xlarge',
output_path='model.tar.gz',
sagemaker_session=sess)
xgb.set_hyperparameters(objective='multi:softmax',
num_class=3,
num_round=100)
data_channels = {
'train': s3_input_train,
'validation': s3_input_validation
}
xgb.fit(data_channels, job_name=job_name)
With the following errors:
ParsingError Traceback (most recent call last)
~/.conda/envs/default/lib/python3.9/site-packages/botocore/configloader.py in raw_config_parse(config_filename, parse_subsections)
148 try:
--> 149 cp.read([path])
150 except (six.moves.configparser.Error, UnicodeDecodeError):
~/.conda/envs/default/lib/python3.9/configparser.py in read(self, filenames, encoding)
696 with open(filename, encoding=encoding) as fp:
--> 697 self._read(fp, filename)
698 except OSError:
~/.conda/envs/default/lib/python3.9/configparser.py in _read(self, fp, fpname)
1115 if e:
-> 1116 raise e
1117
ParsingError: Source contains parsing errors: '/home/studio-lab-user/.aws/config'
[line 5]: 'from sagemaker import image_uris\n'
[line 6]: 'import boto3\n'
During handling of the above exception, another exception occurred:
truncated error at bottom:
ConfigParseError: Unable to parse config file: /home/studio-lab-user/.aws/config