diff --git a/mindspore/lite/examples/train_lenet/model/lenet_export.py b/mindspore/lite/examples/train_lenet/model/lenet_export.py index e3bc6d15ee..8a9cd7c53f 100644 --- a/mindspore/lite/examples/train_lenet/model/lenet_export.py +++ b/mindspore/lite/examples/train_lenet/model/lenet_export.py @@ -23,7 +23,7 @@ from train_utils import TrainWrap n = LeNet5() n.set_train() -context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU", save_graphs=False) +context.set_context(mode=context.PYNATIVE_MODE, device_target="CPU", save_graphs=False) BATCH_SIZE = 32 x = Tensor(np.ones((BATCH_SIZE, 1, 32, 32)), mstype.float32) diff --git a/mindspore/lite/examples/train_lenet/prepare_and_run.sh b/mindspore/lite/examples/train_lenet/prepare_and_run.sh index 9979fe8e2c..88464d1fd5 100755 --- a/mindspore/lite/examples/train_lenet/prepare_and_run.sh +++ b/mindspore/lite/examples/train_lenet/prepare_and_run.sh @@ -52,7 +52,7 @@ if [ "$TARBALL" == "" ]; then else file=$(ls ../../../../output/mindspore-lite-*-train-linux-x64.tar.gz) fi - if [ -f ${file} ]; then + if [[ ${file} != "" ]] && [[ -f ${file} ]]; then TARBALL=${file} else echo "release.tar.gz was not found" diff --git a/mindspore/lite/examples/transfer_learning/prepare_and_run.sh b/mindspore/lite/examples/transfer_learning/prepare_and_run.sh index d6a084d17e..e09c914503 100755 --- a/mindspore/lite/examples/transfer_learning/prepare_and_run.sh +++ b/mindspore/lite/examples/transfer_learning/prepare_and_run.sh @@ -51,7 +51,7 @@ if [ "$TARBALL" == "" ]; then else file=$(ls ../../../../output/mindspore-lite-*-train-linux-x64.tar.gz) fi - if [ -f ${file} ]; then + if [[ ${file} != "" ]] && [[ -f ${file} ]]; then TARBALL=${file} else echo "release.tar.gz was not found"