Skip to content
Snippets Groups Projects
Commit b68d38c8 authored by Abhishek Kadian's avatar Abhishek Kadian Committed by Oleksandr
Browse files

Modify partitioning logic to handle left-over scenes due to integer d… (#89)

* Modify partitioning logic to handle left-over scenes due to integer division
parent 959799b9
No related branches found
No related tags found
No related merge requests found
......@@ -118,14 +118,18 @@ def construct_envs(args):
)
scene_split_size = int(np.floor(len(scenes) / args.num_processes))
scene_splits = [[] for _ in range(args.num_processes)]
for j, s in enumerate(scenes):
scene_splits[j % len(scene_splits)].append(s)
assert sum(map(len, scene_splits)) == len(scenes)
for i in range(args.num_processes):
config_env = cfg_env(config_paths=args.task_config, opts=args.opts)
config_env.defrost()
if len(scenes) > 0:
config_env.DATASET.CONTENT_SCENES = scenes[
i * scene_split_size : (i + 1) * scene_split_size
]
config_env.DATASET.POINTNAVV1.CONTENT_SCENES = scene_splits[i]
config_env.SIMULATOR.HABITAT_SIM_V0.GPU_DEVICE_ID = args.sim_gpu_id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment