@@ -219,60 +219,51 @@ def test_training_step_tensorflow(sagemaker_session):
219
219
name = "MyTrainingStep" , estimator = estimator , inputs = inputs , cache_config = cache_config
220
220
)
221
221
step_request = step .to_request ()
222
- step_request ['Arguments' ]['HyperParameters' ].pop ('sagemaker_job_name' , None )
223
- step_request ['Arguments' ].pop ('ProfilerRuleConfigurations' , None )
222
+ step_request ["Arguments" ]["HyperParameters" ].pop ("sagemaker_job_name" , None )
223
+ step_request ["Arguments" ]["HyperParameters" ].pop ("sagemaker_program" , None )
224
+ step_request ["Arguments" ].pop ("ProfilerRuleConfigurations" , None )
224
225
assert step_request == {
225
- 'Name' :'MyTrainingStep' ,
226
- 'Type' :'Training' ,
227
- 'Arguments' :{
228
- 'AlgorithmSpecification' :{
229
- 'TrainingInputMode' :'File' ,
230
- 'TrainingImage' :'fakeimage' ,
231
- 'EnableSageMakerMetricsTimeSeries' :True
232
- },
233
- 'OutputDataConfig' :{
234
- 'S3OutputPath' :'s3://my-bucket/'
235
- },
236
- 'StoppingCondition' :{
237
- 'MaxRuntimeInSeconds' :86400
226
+ "Name" : "MyTrainingStep" ,
227
+ "Type" : "Training" ,
228
+ "Arguments" : {
229
+ "AlgorithmSpecification" : {
230
+ "TrainingInputMode" : "File" ,
231
+ "TrainingImage" : "fakeimage" ,
232
+ "EnableSageMakerMetricsTimeSeries" : True ,
238
233
},
239
- 'ResourceConfig' :{
240
- 'InstanceCount' :instance_count_parameter ,
241
- 'InstanceType' :instance_type_parameter ,
242
- 'VolumeSizeInGB' :30
234
+ "OutputDataConfig" : {"S3OutputPath" : "s3://my-bucket/" },
235
+ "StoppingCondition" : {"MaxRuntimeInSeconds" : 86400 },
236
+ "ResourceConfig" : {
237
+ "InstanceCount" : instance_count_parameter ,
238
+ "InstanceType" : instance_type_parameter ,
239
+ "VolumeSizeInGB" : 30 ,
243
240
},
244
- ' RoleArn' : ' DummyRole' ,
245
- ' InputDataConfig' : [
241
+ " RoleArn" : " DummyRole" ,
242
+ " InputDataConfig" : [
246
243
{
247
- ' DataSource' : {
248
- ' S3DataSource' : {
249
- ' S3DataType' : ' S3Prefix' ,
250
- ' S3Uri' : data_source_uri_parameter ,
251
- ' S3DataDistributionType' : ' FullyReplicated'
252
- }
244
+ " DataSource" : {
245
+ " S3DataSource" : {
246
+ " S3DataType" : " S3Prefix" ,
247
+ " S3Uri" : data_source_uri_parameter ,
248
+ " S3DataDistributionType" : " FullyReplicated" ,
249
+ }
253
250
},
254
- ' ChannelName' : ' training'
251
+ " ChannelName" : " training" ,
255
252
}
256
253
],
257
- 'HyperParameters' :{
258
- 'batch-size' :training_batch_size_parameter ,
259
- 'epochs' :training_epochs_parameter ,
260
- 'sagemaker_submit_directory' :'"s3://mybucket/source"' ,
261
- 'sagemaker_program' :'"/Volumes/Unix/workplace/pstaub/sagemaker-python-sdk/tests/unit/../data/dummy_script.py"' ,
262
- 'sagemaker_container_log_level' :'20' ,
263
- 'sagemaker_region' :'"us-west-2"' ,
264
- 'sagemaker_distributed_dataparallel_enabled' :'true' ,
265
- 'sagemaker_instance_type' :instance_type_parameter ,
266
- 'sagemaker_distributed_dataparallel_custom_mpi_options' :'""'
254
+ "HyperParameters" : {
255
+ "batch-size" : training_batch_size_parameter ,
256
+ "epochs" : training_epochs_parameter ,
257
+ "sagemaker_submit_directory" : '"s3://mybucket/source"' ,
258
+ "sagemaker_container_log_level" : "20" ,
259
+ "sagemaker_region" : '"us-west-2"' ,
260
+ "sagemaker_distributed_dataparallel_enabled" : "true" ,
261
+ "sagemaker_instance_type" : instance_type_parameter ,
262
+ "sagemaker_distributed_dataparallel_custom_mpi_options" : '""' ,
267
263
},
268
- 'ProfilerConfig' :{
269
- 'S3OutputPath' :'s3://my-bucket/'
270
- }
264
+ "ProfilerConfig" : {"S3OutputPath" : "s3://my-bucket/" },
271
265
},
272
- 'CacheConfig' :{
273
- 'Enabled' :True ,
274
- 'ExpireAfter' :'PT1H'
275
- }
266
+ "CacheConfig" : {"Enabled" : True , "ExpireAfter" : "PT1H" },
276
267
}
277
268
assert step .properties .TrainingJobName .expr == {"Get" : "Steps.MyTrainingStep.TrainingJobName" }
278
269
0 commit comments