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

1052 Upgrade Ignite dependency to 0.4.2 #1053

Merged
merged 23 commits into from
Sep 28, 2020
Merged

1052 Upgrade Ignite dependency to 0.4.2 #1053

merged 23 commits into from
Sep 28, 2020

Conversation

Nic-Ma
Copy link
Contributor

@Nic-Ma Nic-Ma commented Sep 21, 2020

Fixes #1052 .

Description

Ignite released v0.4.2 today, this PR upgraded it.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh --codeformat --coverage.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@Nic-Ma Nic-Ma changed the title [WIP] 1052 Upgrade Ignite dependency to 0.4.2 1052 Upgrade Ignite dependency to 0.4.2 Sep 21, 2020
@Nic-Ma Nic-Ma marked this pull request as ready for review September 21, 2020 14:33
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Sep 21, 2020

Hi @ericspod and @wyli ,

This PR updated all the ignite related logic and hack to v0.4.2.
I already tested locally with the workflow and ignite examples, will submit another PR in tutorial repo to slightly update them.
Could you please help review it?

Thanks.

Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be held til after v0.3 release, unless we are fixing some critical bugs in the workflow

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Sep 21, 2020

I think this should be held til after v0.3 release, unless we are fixing some critical bugs in the workflow

Sure, what are the critical bugs you mean?
Thanks.

@wyli
Copy link
Contributor

wyli commented Sep 21, 2020

I think this should be held til after v0.3 release, unless we are fixing some critical bugs in the workflow

Sure, what are the critical bugs you mean?
Thanks.

meaning things that would break the software features that we'd like to highlight in v0.3

@Nic-Ma Nic-Ma changed the title 1052 Upgrade Ignite dependency to 0.4.2 [WIP] 1052 Upgrade Ignite dependency to 0.4.2 Sep 21, 2020
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Sep 21, 2020

Found some distributed training issue in ignite v0.4.2, mark as WIP.
Thanks.

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Sep 21, 2020

Tracking the distributed training issue in: pytorch/ignite#1307
Thanks.

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Sep 21, 2020

Tracking the distributed training issue in: pytorch/ignite#1307
Thanks.

issue fixed.

@Nic-Ma Nic-Ma changed the title [WIP] 1052 Upgrade Ignite dependency to 0.4.2 1052 Upgrade Ignite dependency to 0.4.2 Sep 22, 2020
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Sep 27, 2020

Hi @wyli ,

I updated the workflow integration test and verified locally.
It's OK for review now.

Thanks.

Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wyli wyli merged commit 0860ff1 into Project-MONAI:master Sep 28, 2020
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Sep 28, 2020

thanks @Nic-Ma may want to incorporate the updated API with a deterministic flag:
https://github.com/pytorch/ignite/blob/84b5d413b68cf0407cb7bd027bec194809a5db2c/ignite/engine/__init__.py#L41-L50

I think we prefer to use monai.utils.set_determinism() for deterministic training, so I didn't add it to our multi_gpu_trainer.
Thanks.

@rijobro
Copy link
Contributor

rijobro commented Sep 29, 2020

Running one of the tutorials, I now get the following error:

Click for error
---------------------------------------------------------------------------
OptionalImportError                       Traceback (most recent call last)
<ipython-input-6-8f07429d3c99> in <module>
     11 from monai.config import print_config
     12 from monai.data import CacheDataset, DataLoader
---> 13 from monai.engines import GanKeys, GanTrainer, default_make_latent
     14 from monai.handlers import CheckpointSaver, MetricLogger, StatsHandler
     15 from monai.networks import normal_init

/opt/monai/monai/engines/__init__.py in <module>
     10 # limitations under the License.
     11 
---> 12 from .evaluator import *
     13 from .multi_gpu_supervised_trainer import *
     14 from .trainer import *

/opt/monai/monai/engines/evaluator.py in <module>
     17 from monai.engines.utils import CommonKeys as Keys
     18 from monai.engines.utils import default_prepare_batch
---> 19 from monai.engines.workflow import Workflow
     20 from monai.inferers import Inferer, SimpleInferer
     21 from monai.transforms import Transform

/opt/monai/monai/engines/workflow.py in <module>
     31 
     32 
---> 33 class Workflow(IgniteEngine):  # type: ignore[valid-type, misc] # due to optional_import
     34     """
     35     Workflow defines the core work process inheriting from Ignite engine.

/opt/monai/monai/utils/module.py in __getattr__(self, name)
    195                 OptionalImportError: When you call this method.
    196             """
--> 197             raise self._exception
    198 
    199         def __call__(self, *_args, **_kwargs):

OptionalImportError: from ignite.engine import Engine (requires 'ignite.engine 0.3.0' by 'exact_version').

I'm running MONAI master and ignite 0.4.2, as verified with print_config:

MONAI version: 0.3.0rc3+9.gc009938
Python version: 3.8.3 (default, May 19 2020, 18:47:26)  [GCC 7.3.0]
OS version: Linux (4.15.0-91-generic)
Numpy version: 1.19.2
Pytorch version: 1.6.0

Optional dependencies:
Pytorch Ignite version: 0.4.2
Nibabel version: 3.1.1
scikit-image version: 0.17.2
Pillow version: 7.2.0
Tensorboard version: 2.3.0
gdown version: 3.12.2
TorchVision version: 0.7.0
ITK version: 5.1.1
tqdm version: 4.50.0

@wyli
Copy link
Contributor

wyli commented Sep 29, 2020

Running one of the tutorials, I now get the following error:

Click for error

---------------------------------------------------------------------------
OptionalImportError                       Traceback (most recent call last)
<ipython-input-6-8f07429d3c99> in <module>
     11 from monai.config import print_config
     12 from monai.data import CacheDataset, DataLoader
---> 13 from monai.engines import GanKeys, GanTrainer, default_make_latent
     14 from monai.handlers import CheckpointSaver, MetricLogger, StatsHandler
     15 from monai.networks import normal_init

/opt/monai/monai/engines/__init__.py in <module>
     10 # limitations under the License.
     11 
---> 12 from .evaluator import *
     13 from .multi_gpu_supervised_trainer import *
     14 from .trainer import *

/opt/monai/monai/engines/evaluator.py in <module>
     17 from monai.engines.utils import CommonKeys as Keys
     18 from monai.engines.utils import default_prepare_batch
---> 19 from monai.engines.workflow import Workflow
     20 from monai.inferers import Inferer, SimpleInferer
     21 from monai.transforms import Transform

/opt/monai/monai/engines/workflow.py in <module>
     31 
     32 
---> 33 class Workflow(IgniteEngine):  # type: ignore[valid-type, misc] # due to optional_import
     34     """
     35     Workflow defines the core work process inheriting from Ignite engine.

/opt/monai/monai/utils/module.py in __getattr__(self, name)
    195                 OptionalImportError: When you call this method.
    196             """
--> 197             raise self._exception
    198 
    199         def __call__(self, *_args, **_kwargs):

OptionalImportError: from ignite.engine import Engine (requires 'ignite.engine 0.3.0' by 'exact_version').

I'm running MONAI master and ignite 0.4.2, as verified with print_config:

MONAI version: 0.3.0rc3+9.gc009938
Python version: 3.8.3 (default, May 19 2020, 18:47:26)  [GCC 7.3.0]
OS version: Linux (4.15.0-91-generic)
Numpy version: 1.19.2
Pytorch version: 1.6.0

Optional dependencies:
Pytorch Ignite version: 0.4.2
Nibabel version: 3.1.1
scikit-image version: 0.17.2
Pillow version: 7.2.0
Tensorboard version: 2.3.0
gdown version: 3.12.2
TorchVision version: 0.7.0
ITK version: 5.1.1
tqdm version: 4.50.0

perhaps there are multiple copies of monai installed on your system? the last line of the error "(requires 'ignite.engine 0.3.0' by 'exact_version')" is not from 0.3.0rc3+9.gc009938

@rijobro
Copy link
Contributor

rijobro commented Sep 29, 2020

Yeah I think you're right, sorry about that.

@wyli
Copy link
Contributor

wyli commented Sep 29, 2020

Yeah I think you're right, sorry about that.

no problem, we'll tag 0.3.0rc4 soon, should be non-breaking since 0.3.0rc2

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.

Upgrade ignite dependency to v0.4.2
4 participants