Skip to content

Commit a697178

Browse files
laurenyupengk19
authored andcommitted
fix: fix logger creation in Chainer integ test script (aws#843)
only one test failed due to a timeout. (the corresponding test failed with the other Python version.) talked to Rui offline.
1 parent 31141e8 commit a697178

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

tests/data/chainer_mnist/distributed_mnist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -26,7 +26,7 @@
2626
import numpy as np
2727
import sagemaker_containers
2828

29-
logger = logging.getLogger('user_script')
29+
logger = logging.getLogger(__name__)
3030
logger.setLevel(logging.INFO)
3131

3232

@@ -173,4 +173,4 @@ def _preprocess_mnist(raw, withlabel, ndim, scale, image_dtype, label_dtype, rgb
173173
def model_fn(model_dir):
174174
model = L.Classifier(MLP(1000, 10))
175175
serializers.load_npz(os.path.join(model_dir, 'model.npz'), model)
176-
return model.predictor
176+
return model.predictor
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
if __name__=='__main__':
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You
4+
# may not use this file except in compliance with the License. A copy of
5+
# the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is
10+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific
12+
# language governing permissions and limitations under the License.
13+
14+
if __name__ == '__main__':
215
"""For use with integration tests expecting failures."""
316
raise Exception('This failure is expected.')

0 commit comments

Comments
 (0)