Skip to content

Commit

Permalink
Fix bundle_root for NNIGen (Project-MONAI#7586)
Browse files Browse the repository at this point in the history
Fixes Project-MONAI#7585  .

### Description

Because the NNI test takes too much time, the previous behavior did not
get caught with the dry-run mode of HPO Gen

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).

---------

Signed-off-by: Mingxin Zheng <mingxinz@nvidia.com>
Co-authored-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Signed-off-by: Yu0610 <612410030@alum.ccu.edu.tw>
  • Loading branch information
2 people authored and Yu0610 committed Apr 11, 2024
1 parent 623a3f4 commit 91db489
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion monai/apps/auto3dseg/hpo_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ def generate(self, output_folder: str = ".") -> None:
self.obj_filename = os.path.join(write_path, "algo_object.pkl")

if isinstance(self.algo, BundleAlgo):
self.algo.export_to_disk(output_folder, task_prefix + task_id, fill_with_datastats=False)
self.algo.export_to_disk(
output_folder, task_prefix + task_id, bundle_root=write_path, fill_with_datastats=False
)
else:
ConfigParser.export_config_file(self.params, write_path)
logger.info(write_path)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_auto3dseg_hpo.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def test_get_history(self) -> None:

NNIGen().run_algo(obj_filename, self.work_dir)
history = import_bundle_algo_history(self.work_dir, only_trained=True)
assert len(history) == 3
assert len(history) == 1

def tearDown(self) -> None:
self.test_dir.cleanup()
Expand Down

0 comments on commit 91db489

Please sign in to comment.