diff --git a/tutorials/source_zh_cn/advanced_use/distributed_training.md b/tutorials/source_zh_cn/advanced_use/distributed_training.md index 62996de0fdd241fdac27b94e44ac676222f86f31..fbbcd4c1d1e435d3e7a41bfc402111b2bd5627b3 100644 --- a/tutorials/source_zh_cn/advanced_use/distributed_training.md +++ b/tutorials/source_zh_cn/advanced_use/distributed_training.md @@ -318,7 +318,7 @@ export RANK_ID=0 echo "start training for device 0" env > env0.log pytest -s -v ./resnet50_distributed_training.py > train.log0 2>&1 -if [ $i -eq 0 ];then +if [ $? -eq 0 ];then echo "training success" else echo "training failed" diff --git a/tutorials/tutorial_code/distributed_training/run.sh b/tutorials/tutorial_code/distributed_training/run.sh index a2078a74ad3f8823dd7b777e8f4c8a2ce772ec7c..b29a4284f61045312c7dbd7f0183e3f8df0c557a 100644 --- a/tutorials/tutorial_code/distributed_training/run.sh +++ b/tutorials/tutorial_code/distributed_training/run.sh @@ -42,7 +42,7 @@ export RANK_ID=0 echo "start training for device 0" env > env0.log pytest -s -v ./resnet50_distributed_training.py > train.log0 2>&1 -if [ $i -eq 0 ];then +if [ $? -eq 0 ];then echo "training success" else echo "training failed"