20
20
from sagemaker .chainer .estimator import Chainer
21
21
from sagemaker .chainer .model import ChainerModel
22
22
from sagemaker .utils import unique_name_from_base
23
- from tests .integ import DATA_DIR , PYTHON_VERSION , TRAINING_DEFAULT_TIMEOUT_MINUTES
23
+ from tests .integ import DATA_DIR , TRAINING_DEFAULT_TIMEOUT_MINUTES
24
24
from tests .integ .timeout import timeout , timeout_and_delete_endpoint_by_name
25
25
26
26
@@ -35,7 +35,9 @@ def test_distributed_cpu_training(sagemaker_local_session, chainer_full_version)
35
35
36
36
37
37
@pytest .mark .local_mode
38
- def test_training_with_additional_hyperparameters (sagemaker_local_session , chainer_full_version ):
38
+ def test_training_with_additional_hyperparameters (
39
+ sagemaker_local_session , chainer_full_version , chainer_full_py_version
40
+ ):
39
41
script_path = os .path .join (DATA_DIR , "chainer_mnist" , "mnist.py" )
40
42
data_path = os .path .join (DATA_DIR , "chainer_mnist" )
41
43
@@ -45,7 +47,7 @@ def test_training_with_additional_hyperparameters(sagemaker_local_session, chain
45
47
train_instance_count = 1 ,
46
48
train_instance_type = "local" ,
47
49
framework_version = chainer_full_version ,
48
- py_version = PYTHON_VERSION ,
50
+ py_version = chainer_full_py_version ,
49
51
sagemaker_session = sagemaker_local_session ,
50
52
hyperparameters = {"epochs" : 1 },
51
53
use_mpi = True ,
@@ -62,7 +64,9 @@ def test_training_with_additional_hyperparameters(sagemaker_local_session, chain
62
64
63
65
@pytest .mark .canary_quick
64
66
@pytest .mark .regional_testing
65
- def test_attach_deploy (sagemaker_session , chainer_full_version , cpu_instance_type ):
67
+ def test_attach_deploy (
68
+ sagemaker_session , chainer_full_version , chainer_full_py_version , cpu_instance_type
69
+ ):
66
70
with timeout (minutes = TRAINING_DEFAULT_TIMEOUT_MINUTES ):
67
71
script_path = os .path .join (DATA_DIR , "chainer_mnist" , "mnist.py" )
68
72
data_path = os .path .join (DATA_DIR , "chainer_mnist" )
@@ -71,7 +75,7 @@ def test_attach_deploy(sagemaker_session, chainer_full_version, cpu_instance_typ
71
75
entry_point = script_path ,
72
76
role = "SageMakerRole" ,
73
77
framework_version = chainer_full_version ,
74
- py_version = PYTHON_VERSION ,
78
+ py_version = chainer_full_py_version ,
75
79
train_instance_count = 1 ,
76
80
train_instance_type = cpu_instance_type ,
77
81
sagemaker_session = sagemaker_session ,
@@ -100,7 +104,12 @@ def test_attach_deploy(sagemaker_session, chainer_full_version, cpu_instance_typ
100
104
101
105
102
106
@pytest .mark .local_mode
103
- def test_deploy_model (chainer_local_training_job , sagemaker_local_session , chainer_full_version ):
107
+ def test_deploy_model (
108
+ chainer_local_training_job ,
109
+ sagemaker_local_session ,
110
+ chainer_full_version ,
111
+ chainer_full_py_version ,
112
+ ):
104
113
script_path = os .path .join (DATA_DIR , "chainer_mnist" , "mnist.py" )
105
114
106
115
model = ChainerModel (
@@ -109,7 +118,7 @@ def test_deploy_model(chainer_local_training_job, sagemaker_local_session, chain
109
118
entry_point = script_path ,
110
119
sagemaker_session = sagemaker_local_session ,
111
120
framework_version = chainer_full_version ,
112
- py_version = PYTHON_VERSION ,
121
+ py_version = chainer_full_py_version ,
113
122
)
114
123
115
124
predictor = model .deploy (1 , "local" )
@@ -120,7 +129,7 @@ def test_deploy_model(chainer_local_training_job, sagemaker_local_session, chain
120
129
121
130
122
131
def _run_mnist_training_job (
123
- sagemaker_session , instance_type , instance_count , chainer_full_version , wait = True
132
+ sagemaker_session , instance_type , instance_count , chainer_version , py_version , wait = True
124
133
):
125
134
script_path = (
126
135
os .path .join (DATA_DIR , "chainer_mnist" , "mnist.py" )
@@ -133,8 +142,8 @@ def _run_mnist_training_job(
133
142
chainer = Chainer (
134
143
entry_point = script_path ,
135
144
role = "SageMakerRole" ,
136
- framework_version = chainer_full_version ,
137
- py_version = PYTHON_VERSION ,
145
+ framework_version = chainer_version ,
146
+ py_version = py_version ,
138
147
train_instance_count = instance_count ,
139
148
train_instance_type = instance_type ,
140
149
sagemaker_session = sagemaker_session ,
0 commit comments