Skip to content

AutoRunner bug with AlgoEnsembleBestByFold before setting the num_fold #5665

Closed

Description

@mingxin-zheng

Describe the bug
AutoRunner will fail if the users first set their ensemble method to AlgoEnsembleBestByFold and then change the num_fold by set_num_fold

To Reproduce

runner = AutoRunner()
runner.set_training_params(train_param)  # make it 2 epochs in train_param
runner.set_ensemble_method("AlgoEnsembleBestByFold")
runner.set_num_fold(1)
runner.run()
Traceback (most recent call last):
  File "/workspace/monai/monai-in-dev/tests/test_integration_autorunner.py", line 108, in test_autorunner_ensemble
    runner.run()
  File "/workspace/monai/monai-in-dev/monai/apps/auto3dseg/auto_runner.py", line 633, in run
    preds = ensembler(pred_param=self.pred_params)
  File "/workspace/monai/monai-in-dev/monai/apps/auto3dseg/ensemble_builder.py", line 156, in __call__
    infer_instance = algo[AlgoEnsembleKeys.ALGO]
TypeError: 'NoneType' object is not subscriptable

Expected behavior
The ensemble method can update itself after users set_num_fold

Activity

  1. self-assigned this
    on Dec 6, 2022
  2. added a commit that references this issue on Dec 6, 2022
    6fa4bce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions