Browse Source

modify dataste_sink_mode

tags/v1.0.0
wukesong 5 years ago
parent
commit
44d7d85004
4 changed files with 12 additions and 4 deletions
  1. +3
    -1
      model_zoo/official/cv/alexnet/eval.py
  2. +3
    -1
      model_zoo/official/cv/alexnet/train.py
  3. +3
    -1
      model_zoo/official/cv/lenet/eval.py
  4. +3
    -1
      model_zoo/official/cv/lenet/train.py

+ 3
- 1
model_zoo/official/cv/alexnet/eval.py View File

@@ -18,6 +18,7 @@ eval alexnet according to model file:
python eval.py --data_path /YourDataPath --ckpt_path Your.ckpt
"""

import ast
import argparse
from src.config import alexnet_cfg as cfg
from src.dataset import create_dataset_cifar10
@@ -36,7 +37,8 @@ if __name__ == "__main__":
parser.add_argument('--data_path', type=str, default="./", help='path where the dataset is saved')
parser.add_argument('--ckpt_path', type=str, default="./ckpt", help='if is test, must provide\
path where the trained ckpt file')
parser.add_argument('--dataset_sink_mode', type=bool, default=True, help='dataset_sink_mode is False or True')
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval,
default=True, help='dataset_sink_mode is False or True')
args = parser.parse_args()

context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target)


+ 3
- 1
model_zoo/official/cv/alexnet/train.py View File

@@ -18,6 +18,7 @@ train alexnet and get network model files(.ckpt) :
python train.py --data_path /YourDataPath
"""

import ast
import argparse
from src.config import alexnet_cfg as cfg
from src.dataset import create_dataset_cifar10
@@ -38,7 +39,8 @@ if __name__ == "__main__":
parser.add_argument('--data_path', type=str, default="./", help='path where the dataset is saved')
parser.add_argument('--ckpt_path', type=str, default="./ckpt", help='if is test, must provide\
path where the trained ckpt file')
parser.add_argument('--dataset_sink_mode', type=bool, default=True, help='dataset_sink_mode is False or True')
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval,
default=True, help='dataset_sink_mode is False or True')
args = parser.parse_args()

context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target)


+ 3
- 1
model_zoo/official/cv/lenet/eval.py View File

@@ -19,6 +19,7 @@ python eval.py --data_path /YourDataPath --ckpt_path Your.ckpt
"""

import os
import ast
import argparse
import mindspore.nn as nn
from mindspore import context
@@ -37,7 +38,8 @@ if __name__ == "__main__":
help='path where the dataset is saved')
parser.add_argument('--ckpt_path', type=str, default="", help='if mode is test, must provide\
path where the trained ckpt file')
parser.add_argument('--dataset_sink_mode', type=bool, default=False, help='dataset_sink_mode is False or True')
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval,
default=False, help='dataset_sink_mode is False or True')

args = parser.parse_args()



+ 3
- 1
model_zoo/official/cv/lenet/train.py View File

@@ -19,6 +19,7 @@ python train.py --data_path /YourDataPath
"""

import os
import ast
import argparse
from src.config import mnist_cfg as cfg
from src.dataset import create_dataset
@@ -38,7 +39,8 @@ if __name__ == "__main__":
help='path where the dataset is saved')
parser.add_argument('--ckpt_path', type=str, default="./ckpt", help='if is test, must provide\
path where the trained ckpt file')
parser.add_argument('--dataset_sink_mode', type=bool, default=True, help='dataset_sink_mode is False or True')
parser.add_argument('--dataset_sink_mode', type=ast.literal_eval, default=True,
help='dataset_sink_mode is False or True')

args = parser.parse_args()



Loading…
Cancel
Save