Skip to content

Commit

Permalink
add train_dataset and val_dataset to the argument
Browse files Browse the repository at this point in the history
let user can use different name of train dataset and validation dataset.
  • Loading branch information
qiaohaijun committed Jan 15, 2016
1 parent 98b2e77 commit c064769
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions example/image-classification/train_imagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
help='the name of log file')
parser.add_argument('--log-dir', type=str, default="/tmp/",
help='directory of the log file')
parser.add_argument('--train-dataset', type=str, default="train.rec",
help='train dataset name')
parser.add_argument('--val-dataset', type=str, default="val.rec",
help="validation dataset name")
args = parser.parse_args()

# network
Expand All @@ -49,7 +53,7 @@
def get_iterator(args, kv):
data_shape = (3, 224, 224)
train = mx.io.ImageRecordIter(
path_imgrec = args.data_dir + "train.rec",
path_imgrec = args.data_dir + args.train_dataset,
mean_r = 123.68,
mean_g = 116.779,
mean_b = 103.939,
Expand All @@ -61,7 +65,7 @@ def get_iterator(args, kv):
part_index = kv.rank)

val = mx.io.ImageRecordIter(
path_imgrec = args.data_dir + "val.rec",
path_imgrec = args.data_dir + args.val_dataset,
mean_r = 123.68,
mean_g = 116.779,
mean_b = 103.939,
Expand Down

0 comments on commit c064769

Please sign in to comment.