for scene in tqdm(data_loader.scenes):
dump_example(args, scene)
else:
Parallel(n_jobs=args.num_threads)(delayed(dump_example)(args, scene) for scene in tqdm(data_loader.scenes))
print("Generating train val lists")
np.random.seed(8964)
After Change
with ProcessPool(max_workers=args.num_threads) as pool:
tasks = pool.map(dump_example, [args]*n_scenes, data_loader.scenes)
try:
for _ in tqdm(tasks.result(), total=n_scenes):
pass
except KeyboardInterrupt as e:
tasks.cancel()
raise e