Skip to content

Commit 4fdd014

Browse files
hXl3snv-kkudrynski
authored andcommitted
[Convnets] 21.09 Fixes
1 parent 88e5298 commit 4fdd014

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • MxNet/Classification/RN50v1.5

‎MxNet/Classification/RN50v1.5/dali.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def add_dali_args(parser):
3636

3737
group.add_argument('--dali-nvjpeg-width-hint', type=int, default=5980, help="Width hint value for nvJPEG (in pixels)")
3838
group.add_argument('--dali-nvjpeg-height-hint', type=int, default=6430, help="Height hint value for nvJPEG (in pixels)")
39+
group.add_argument('--dali-dont-use-mmap', default=False, action='store_true', help="Use plain I/O instead of MMAP for datasets")
3940
return parser
4041

4142

@@ -47,7 +48,8 @@ def __init__(self, args, batch_size, num_threads, device_id, rec_path, idx_path,
4748
):
4849
super(HybridTrainPipe, self).__init__(batch_size, num_threads, device_id, seed=12 + device_id, prefetch_queue_depth = prefetch_queue)
4950
self.input = ops.MXNetReader(path=[rec_path], index_path=[idx_path],
50-
random_shuffle=True, shard_id=shard_id, num_shards=num_shards)
51+
random_shuffle=True, shard_id=shard_id, num_shards=num_shards,
52+
dont_use_mmap=args.dali_dont_use_mmap)
5153

5254
if dali_cpu:
5355
dali_device = "cpu"
@@ -101,7 +103,8 @@ def __init__(self, args, batch_size, num_threads, device_id, rec_path, idx_path,
101103
nvjpeg_width_hint=5980, nvjpeg_height_hint=6430):
102104
super(HybridValPipe, self).__init__(batch_size, num_threads, device_id, seed=12 + device_id, prefetch_queue_depth=prefetch_queue)
103105
self.input = ops.MXNetReader(path=[rec_path], index_path=[idx_path],
104-
random_shuffle=False, shard_id=shard_id, num_shards=num_shards)
106+
random_shuffle=False, shard_id=shard_id, num_shards=num_shards,
107+
dont_use_mmap=args.dali_dont_use_mmap)
105108

106109
if dali_cpu:
107110
dali_device = "cpu"

0 commit comments

Comments
��(0)