You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by zh...@apache.org on 2020/06/14 01:31:28 UTC
[incubator-mxnet] branch master updated: remove dependency on
train_mnist.py script (#18550)
This is an automated email from the ASF dual-hosted git repository.
zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new da25273 remove dependency on train_mnist.py script (#18550)
da25273 is described below
commit da252734c70164a0983404de076464ba7a526a60
Author: Manu Seth <22...@users.noreply.github.com>
AuthorDate: Sat Jun 13 18:30:29 2020 -0700
remove dependency on train_mnist.py script (#18550)
* remove dependency on train_mnist.py script
* remove image classification tests from nightly
---
cd/python/docker/test_python_image.sh | 9 +---
ci/docker/runtime_functions.sh | 19 +------
docker/docker-python/README.md | 1 -
docker/docker-python/build_python_dockerfile.sh | 2 -
tests/nightly/JenkinsfileForBinaries | 10 +---
tests/nightly/test_image_classification.sh | 67 -------------------------
tools/profile/tune_mnist.sh | 23 ---------
7 files changed, 4 insertions(+), 127 deletions(-)
diff --git a/cd/python/docker/test_python_image.sh b/cd/python/docker/test_python_image.sh
index b10dcfb..be4f9dc 100755
--- a/cd/python/docker/test_python_image.sh
+++ b/cd/python/docker/test_python_image.sh
@@ -32,14 +32,9 @@ if [ -z "${MXNET_COMMIT_ID}" ]; then
fi
# Execute tests
-if [[ $mxnet_variant == cu* ]]; then
- mnist_params="--gpu 0"
- test_conv_params="--gpu"
-fi
-
-if [[ $mxnet_variant == cpu ]]; then
+if [[ $mxnet_variant != native ]]; then
python3 tests/python/mkl/test_mkldnn.py
fi
-python3 example/image-classification/train_mnist.py ${mnist_params}
+# TODO: Add more tests (18549)
diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index e5514a7..a913ca5 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -1403,13 +1403,6 @@ nightly_test_imagenet_inference() {
./unit_test_imagenet_inference.sh
}
-#Runs a simple MNIST training example
-nightly_test_image_classification() {
- set -ex
- export DMLC_LOG_STACK_TRACE_DEPTH=10
- ./tests/nightly/test_image_classification.sh
-}
-
#Single Node KVStore Test
nightly_test_KVStore_singleNode() {
set -ex
@@ -1894,21 +1887,11 @@ cd_integration_test_pypi() {
set -ex
source /opt/rh/rh-python36/enable
- local gpu_enabled=${1:-"false"}
-
- local test_conv_params=''
- local mnist_params=''
-
- if [ "${gpu_enabled}" = "true" ]; then
- mnist_params="--gpu 0"
- test_conv_params="--gpu"
- fi
-
# install mxnet wheel package
pip3 install --user ./wheel_build/dist/*.whl
# execute tests
- python3 /work/mxnet/example/image-classification/train_mnist.py ${mnist_params}
+ # TODO: Add tests (18549)
}
# Publishes wheel to PyPI
diff --git a/docker/docker-python/README.md b/docker/docker-python/README.md
index 75fb2b2..a5dd0e3 100644
--- a/docker/docker-python/README.md
+++ b/docker/docker-python/README.md
@@ -47,7 +47,6 @@ For example:
`./build_python_dockerfile.sh 1.3.0 1.3.0.post0 ~/build-docker/incubator-mxnet`
### Tests run
-* [train_mnist.py](https://github.com/apache/incubator-mxnet/blob/master/example/image-classification/train_mnist.py)
* [test_mxnet.py](https://github.com/apache/incubator-mxnet/blob/master/docker/docker-python/test_mxnet.py): This script is used to make sure that the docker image builds the expected mxnet version. That is, the version picked by pip is the same as as the version passed as a parameter.
### Dockerhub Credentials
diff --git a/docker/docker-python/build_python_dockerfile.sh b/docker/docker-python/build_python_dockerfile.sh
index cdcc362..6dc77e0 100755
--- a/docker/docker-python/build_python_dockerfile.sh
+++ b/docker/docker-python/build_python_dockerfile.sh
@@ -58,7 +58,6 @@ docker_test_image_cpu(){
python_version="${2}"
echo "Running tests on mxnet/python:${image_tag}"
docker run -v ${test_dir}:/mxnet mxnet/python:${image_tag} bash -c "${python_version} /mxnet/docker/docker-python/test_mxnet.py ${mxnet_version}"
- docker run -v ${test_dir}:/mxnet mxnet/python:${image_tag} bash -c "${python_version} /mxnet/example/image-classification/train_mnist.py"
}
docker_test_image_gpu(){
@@ -66,7 +65,6 @@ docker_test_image_gpu(){
python_version="${2}"
echo "Running tests on mxnet/python:${1}"
nvidia-docker run -v ${test_dir}:/mxnet mxnet/python:${image_tag} bash -c "${python_version} /mxnet/docker/docker-python/test_mxnet.py ${mxnet_version}"
- nvidia-docker run -v ${test_dir}:/mxnet mxnet/python:${image_tag} bash -c "${python_version} /mxnet/example/image-classification/train_mnist.py --gpus 0,1,2,3"
}
# if both $MXNET_DOCKERHUB_PASSWORD and $MXNET_DOCKERHUB_USERNAME environment variables are set, docker will automatically login
diff --git a/tests/nightly/JenkinsfileForBinaries b/tests/nightly/JenkinsfileForBinaries
index be65398..8470129 100755
--- a/tests/nightly/JenkinsfileForBinaries
+++ b/tests/nightly/JenkinsfileForBinaries
@@ -51,15 +51,7 @@ core_logic: {
}
stage('NightlyTests'){
- parallel 'ImageClassification: GPU': {
- node(NODE_LINUX_GPU) {
- ws('workspace/nt-ImageClassificationTest') {
- utils.unpack_and_init('gpu', mx_lib)
- utils.docker_run('ubuntu_build_cuda', 'nightly_test_image_classification', true)
- }
- }
- },
- 'ImageNet Inference: GPU': {
+ parallel 'ImageNet Inference: GPU': {
node(NODE_LINUX_GPU) {
ws('workspace/nt-ImageInferenceTest') {
utils.unpack_and_init('gpu', mx_lib)
diff --git a/tests/nightly/test_image_classification.sh b/tests/nightly/test_image_classification.sh
deleted file mode 100755
index 1e4508f..0000000
--- a/tests/nightly/test_image_classification.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/bash
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-if [ -f $(which nvidia-smi) ]; then
- if [ $# -eq 1 ]; then
- num_gpus=$1
- else
- num_gpus=$(nvidia-smi -L | grep "GPU" | wc -l)
- fi
- gpus=`seq 0 $((num_gpus-1)) | paste -sd ","`
- device_arg="--gpus $gpus"
-else
- device_arg=""
-fi
-
-# check if the final evaluation accuracy exceed the threshold
-check_val() {
- expected=$1
- pass="Final validation >= $expected, PASS"
- fail="Final validation < $expected, FAIL"
- python tools/parse_log.py log --format none | tail -n1 | \
- awk "{ if (\$3~/^[.0-9]+$/ && \$3 > $expected) print \"$pass\"; else print \"$fail\"}"
- rm -f log
-}
-
-example_dir=example/image-classification
-# python: lenet + mnist
-test_lenet() {
- optimizers="adam sgd adagrad"
- for optimizer in ${optimizers}; do
- echo "OPTIMIZER: $optimizer"
- if [ "$optimizer" == "adam" ]; then
- learning_rate=0.0005
- else
- learning_rate=0.01
- fi
- desired_accuracy=0.98
- python $example_dir/train_mnist.py --lr $learning_rate \
- --network lenet --optimizer $optimizer --gpus $gpus \
- --num-epochs 10 2>&1 | tee log
- if [ $? -ne 0 ]; then
- return $?
- fi
- check_val $desired_accuracy
- done
-}
-
-test_lenet
-
-exit $errors
diff --git a/tools/profile/tune_mnist.sh b/tools/profile/tune_mnist.sh
deleted file mode 100755
index bf395de..0000000
--- a/tools/profile/tune_mnist.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-SCRIPTDIR=$(realpath $(dirname $0))
-TOPDIR=${SCRIPTDIR}/../../
-cd ${TOPDIR}
-/bin/bash ${SCRIPTDIR}/tune_python.sh example/image-classification/train_mnist.py --network=mlp --profile=all --num-epochs=1 $@
-