!6847 modify shell

Merge pull request !6847 from wukesong/alexnet-shell-modify
This commit is contained in:
mindspore-ci-bot 2020-09-25 11:10:01 +08:00 committed by Gitee
commit a5737fb976
7 changed files with 53 additions and 25 deletions

View File

@ -41,6 +41,7 @@ if __name__ == "__main__":
path where the trained ckpt file')
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval,
default=True, help='dataset_sink_mode is False or True')
parser.add_argument('--device_id', type=int, default=0, help='device id of GPU or Ascend. (Default: 0)')
args = parser.parse_args()
context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target)

View File

@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
# an simple tutorial as follows, more parameters can be setting
if [ $# != 3 ]
then
echo "Usage: sh run_train.sh [RANK_TABLE_FILE] [cifar10|imagenet] [DATA_PATH]"
echo "Usage: sh run_distribution_ascend.sh [RANK_TABLE_FILE] [cifar10|imagenet] [DATA_PATH]"
exit 1
fi

View File

@ -13,8 +13,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
# an simple tutorial as follows, more parameters can be setting
script_self=$(readlink -f "$0")
self_path=$(dirname "${script_self}")
python -s ${self_path}/../eval.py --device_target="Ascend" > log.txt 2>&1 &
if [ $# != 4 ]
then
echo "Usage: sh run_standalone_eval_ascend.sh [cifar10|imagenet] [DATA_PATH] [CKPT_PATH] [DEVICE_ID]"
exit 1
fi
export DATASET_NAME=$1
export DATA_PATH=$2
export CKPT_PATH=$3
export DEVICE_ID=$4
python eval.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH --ckpt_path=$CKPT_PATH \
--device_id=$DEVICE_ID --device_target="Ascend" > log.txt 2>&1 &

View File

@ -13,8 +13,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
# an simple tutorial as follows, more parameters can be setting
script_self=$(readlink -f "$0")
self_path=$(dirname "${script_self}")
python -s ${self_path}/../eval.py --device_target="GPU" > log.txt 2>&1 &
if [ $# != 4 ]
then
echo "Usage: sh run_standalone_eval_gpu.sh [cifar10|imagenet] [DATA_PATH] [CKPT_PATH] [DEVICE_ID]"
exit 1
fi
export DATASET_NAME=$1
export DATA_PATH=$2
export CKPT_PATH=$3
export DEVICE_ID=$4
python eval.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH --ckpt_path=$CKPT_PATH \
--device_id=$DEVICE_ID --device_target="GPU" > log.txt 2>&1 &

View File

@ -13,11 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
# an simple tutorial as follows, more parameters can be setting
if [ $# != 3 ]
then
echo "Usage: sh run_standalone_train_ascend.sh [cifar10|imagenet] [DATA_PATH] [DEVICE_ID]"
exit 1
fi
export DEVICE_NUM=1
export RANK_SIZE=1
export DATASET_NAME=$1
export DATA_PATH=$2
export DEVICE_ID=$3
# an simple tutorial, more
script_self=$(readlink -f "$0")
self_path=$(dirname "${script_self}")
python -s ${self_path}/../train.py --device_target="Ascend" > log.txt 2>&1 &
python train.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH \
--device_id=$DEVICE_ID --device_target="Ascend" > log.txt 2>&1 &

View File

@ -13,11 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
export DEVICE_NUM=1
export RANK_SIZE=1
# an simple tutorial as follows, more parameters can be setting
script_self=$(readlink -f "$0")
self_path=$(dirname "${script_self}")
python -s ${self_path}/../train.py --device_target="GPU" > log.txt 2>&1 &
if [ $# != 3 ]
then
echo "Usage: sh run_standalone_train_gpu.sh [cifar10|imagenet] [DATA_PATH] [DEVICE_ID]"
exit 1
fi
export DATASET_NAME=$1
export DATA_PATH=$2
export DEVICE_ID=$3
python train.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH \
--device_id=$DEVICE_ID --device_target="GPU" > log.txt 2>&1 &

View File

@ -51,8 +51,7 @@ if __name__ == "__main__":
path where the trained ckpt file')
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval,
default=True, help='dataset_sink_mode is False or True')
parser.add_argument('--device_id', type=int, default=0, help='device id of GPU or Ascend. (Default: None)')
parser.add_argument('--device_id', type=int, default=0, help='device id of GPU or Ascend. (Default: 0)')
args = parser.parse_args()
if args.dataset_name == "cifar10":