16
16
17
17
DUMMY_IAM_ROLE = 'arn:aws:iam::111111111111:role/service-role/AmazonSageMaker-ExecutionRole-20200101T000001'
18
18
LOCAL_SESSION = LocalSession ()
19
- LOCAL_SESSION .config = {'local' : {'local_code' : True }} # Ensure full code locality, see: https://sagemaker.readthedocs.io/en/stable/overview.html#local-mode
19
+ LOCAL_SESSION .config = {'local' : {'local_code' : True }} # Ensure full code locality, see: https://sagemaker.readthedocs.io/en/stable/overview.html#local-mode
20
+ FRAMEWORK_VERSION = "1.7-1"
20
21
21
22
22
23
def do_inference_on_local_endpoint (predictor , libsvm_str ):
@@ -27,7 +28,8 @@ def do_inference_on_local_endpoint(predictor, libsvm_str):
27
28
28
29
def main ():
29
30
print ('Starting model training.' )
30
- print ('Note: if launching for the first time in local mode, container image download might take a few minutes to complete.' )
31
+ print (
32
+ 'Note: if launching for the first time in local mode, container image download might take a few minutes to complete.' )
31
33
32
34
hyperparameters = {
33
35
"max_depth" : "5" ,
@@ -46,9 +48,9 @@ def main():
46
48
role = DUMMY_IAM_ROLE ,
47
49
instance_count = 1 ,
48
50
instance_type = 'local' ,
49
- framework_version = "1.2-1" ,
51
+ framework_version = FRAMEWORK_VERSION ,
50
52
sagemaker_session = LOCAL_SESSION ,
51
- output_path = 'file://model/' # Save trained model and any additional artifacts locally
53
+ output_path = 'file://model/' # Save trained model and any additional artifacts locally
52
54
)
53
55
54
56
train_input = TrainingInput ("file://data/train/abalone" , content_type = "text/libsvm" )
@@ -65,7 +67,7 @@ def main():
65
67
role = DUMMY_IAM_ROLE ,
66
68
entry_point = "inference.py" ,
67
69
source_dir = "./code" ,
68
- framework_version = "1.2-1" ,
70
+ framework_version = FRAMEWORK_VERSION ,
69
71
sagemaker_session = LOCAL_SESSION
70
72
)
71
73
0 commit comments