auto reduce worker num

This commit is contained in:
QuanyiLi
2023-05-08 10:02:13 +01:00
parent 730efa86a8
commit b85be760c1
2 changed files with 11 additions and 9 deletions

View File

@@ -18,9 +18,8 @@ def test_combine_multiple_dataset():
summary, sorted_scenarios, mapping = read_dataset_summary(dataset_path)
for scenario_file in sorted_scenarios:
read_scenario(os.path.join(dataset_path, mapping[scenario_file], scenario_file))
num_worker = 4 if len(summary) > 4 else 1
success, result = verify_loading_into_metadrive(
dataset_path, result_save_dir="test_dataset", steps_to_run=1000, num_workers=num_worker
dataset_path, result_save_dir="test_dataset", steps_to_run=1000, num_workers=4
)
assert success