Browse Source

add dataset parallel for resnet101

tags/v0.3.0-alpha
meixiaowei 5 years ago
parent
commit
164810e98f
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      example/resnet101_imagenet2012/dataset.py

+ 2
- 2
example/resnet101_imagenet2012/dataset.py View File

@@ -76,8 +76,8 @@ def create_dataset(dataset_path, do_train, repeat_num=1, batch_size=32):


type_cast_op = C2.TypeCast(mstype.int32) type_cast_op = C2.TypeCast(mstype.int32)


ds = ds.map(input_columns="image", operations=trans)
ds = ds.map(input_columns="label", operations=type_cast_op)
ds = ds.map(input_columns="image", operations=trans, num_parallel_workers=8)
ds = ds.map(input_columns="label", operations=type_cast_op, num_parallel_workers=8)


# apply shuffle operations # apply shuffle operations
ds = ds.shuffle(buffer_size=config.buffer_size) ds = ds.shuffle(buffer_size=config.buffer_size)


Loading…
Cancel
Save