forked from mindspore-Ecosystem/mindspore
!6847 modify shell
Merge pull request !6847 from wukesong/alexnet-shell-modify
This commit is contained in:
commit
a5737fb976
|
@ -41,6 +41,7 @@ if __name__ == "__main__":
|
||||||
path where the trained ckpt file')
|
path where the trained ckpt file')
|
||||||
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval,
|
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval,
|
||||||
default=True, help='dataset_sink_mode is False or True')
|
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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target)
|
context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target)
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
# an simple tutorial as follows, more parameters can be setting
|
||||||
if [ $# != 3 ]
|
if [ $# != 3 ]
|
||||||
then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,17 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
# an simple tutorial as follows, more parameters can be setting
|
# an simple tutorial as follows, more parameters can be setting
|
||||||
script_self=$(readlink -f "$0")
|
if [ $# != 4 ]
|
||||||
self_path=$(dirname "${script_self}")
|
then
|
||||||
python -s ${self_path}/../eval.py --device_target="Ascend" > log.txt 2>&1 &
|
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 &
|
||||||
|
|
|
@ -13,8 +13,17 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
# an simple tutorial as follows, more parameters can be setting
|
# an simple tutorial as follows, more parameters can be setting
|
||||||
script_self=$(readlink -f "$0")
|
if [ $# != 4 ]
|
||||||
self_path=$(dirname "${script_self}")
|
then
|
||||||
python -s ${self_path}/../eval.py --device_target="GPU" > log.txt 2>&1 &
|
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 &
|
||||||
|
|
|
@ -13,11 +13,16 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# 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 DATASET_NAME=$1
|
||||||
export RANK_SIZE=1
|
export DATA_PATH=$2
|
||||||
|
export DEVICE_ID=$3
|
||||||
|
|
||||||
# an simple tutorial, more
|
python train.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH \
|
||||||
script_self=$(readlink -f "$0")
|
--device_id=$DEVICE_ID --device_target="Ascend" > log.txt 2>&1 &
|
||||||
self_path=$(dirname "${script_self}")
|
|
||||||
python -s ${self_path}/../train.py --device_target="Ascend" > log.txt 2>&1 &
|
|
||||||
|
|
|
@ -13,11 +13,16 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
export DEVICE_NUM=1
|
|
||||||
export RANK_SIZE=1
|
|
||||||
|
|
||||||
# an simple tutorial as follows, more parameters can be setting
|
# an simple tutorial as follows, more parameters can be setting
|
||||||
script_self=$(readlink -f "$0")
|
if [ $# != 3 ]
|
||||||
self_path=$(dirname "${script_self}")
|
then
|
||||||
python -s ${self_path}/../train.py --device_target="GPU" > log.txt 2>&1 &
|
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 &
|
||||||
|
|
|
@ -51,8 +51,7 @@ if __name__ == "__main__":
|
||||||
path where the trained ckpt file')
|
path where the trained ckpt file')
|
||||||
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval,
|
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval,
|
||||||
default=True, help='dataset_sink_mode is False or True')
|
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)')
|
||||||
parser.add_argument('--device_id', type=int, default=0, help='device id of GPU or Ascend. (Default: None)')
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.dataset_name == "cifar10":
|
if args.dataset_name == "cifar10":
|
||||||
|
|
Loading…
Reference in New Issue