Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto3DSeg skip trained algos #6290

Merged
merged 4 commits into from
Apr 5, 2023
Merged

Conversation

myron
Copy link
Collaborator

@myron myron commented Apr 5, 2023

Issues: #6291

Allows to skip the already trained algos, and continue training only for the non-trained ones.

after this PR, the default option AutoRunner(train=None) will have this behavior, whereas manually setting AutoRunner(train=True/False) will always train all or skip all training. Previously we can only train all or skip all (without any option to resume)

@myron myron added this to the Auto3DSeg enhancement [P0 v1.2] milestone Apr 5, 2023
@myron myron requested a review from mingxin-zheng April 5, 2023 04:11
@mingxin-zheng
Copy link
Contributor

Hi @myron , thanks for the PR. Please run ./runtests --autofix for the format fix, and other looks good to me.

@myron
Copy link
Collaborator Author

myron commented Apr 5, 2023

I ran it before, and I just ran it again, it sees to issues on my machine (macos)

black-fix
python -m black, 22.6.0 (compiled: no)
Python (CPython) 3.9.7
All done! ✨ 🍰 ✨
1065 files left unchanged.
passed!

where can i see what the issue is here on github?

@myron
Copy link
Collaborator Author

myron commented Apr 5, 2023

So it seems the issue was my version of "black"

I've updated it to black 23.3.0 and it removed 1 extra line, I just pushed it , plz check
previously I had black==22.6.0 , the environment is managed by "conda" and it considered it to be the latest version, and wouldn't update. I had to uninstall it, and install via "pip".

We probably should add a version number of black into requirements-dev.txt , or may be it something specific to my machine
@mingxin-zheng @wyli

@myron myron force-pushed the autoseg_restarts branch from 4cda751 to b712d73 Compare April 5, 2023 07:14
Signed-off-by: myron <[email protected]>
@wyli wyli merged commit fa05609 into Project-MONAI:dev Apr 5, 2023
wyli added a commit that referenced this pull request Apr 5, 2023
wyli added a commit that referenced this pull request Apr 5, 2023
Reverts #6290
fixes #6294

this commit is not compatible with the integration tests

---------

Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Mingxin Zheng <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Mingxin Zheng <[email protected]>
wyli pushed a commit that referenced this pull request Apr 6, 2023
Second PR for issue #6291

Since the previous PR #6290
was reverted #6295

Allows to skip the already trained algos, and continue training only for
the non-trained ones.

after this PR, the default option AutoRunner(train=None) will have this
behavior, whereas manually setting AutoRunner(train=True/False) will
always train all or skip all training. Previously we can only train all
or skip all (without any option to resume)

I changed  import_bundle_algo_history() to return a better algo_dict 

previously it returned "list[dict(name: algo)]" - a list of dict, but
each dict must have a single key name "name => algo". Not it returns a
list of dicts, each with several keys dict(AlgoEnsembleKeys.ID: name,
AlgoEnsembleKeys.ALGO, algo, "is_trained": bool, etc).
this allows to put additional metadata inside of each algo_dict, and
it's easier to read it back.

previously, to get a name we had to use "name = history[0].keys()[0]",
now it's more elegant "name = history[0][AlgoEnsembleKeys.ID]".

this however required to change many files, everywhere where
import_bundle_algo_history and export_bundle_algo_history was used.

All the tests have passed, except for "integration GPU utilization
tests" , but those errors seems unrelated



After this PR, tutorials need to be updated too
Project-MONAI/tutorials#1288

---------

Signed-off-by: myron <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants