Skip to content

DeprecationWarning when import monai #8060

Open

Description

@KumoLiu
/usr/local/lib/python3.10/dist-packages/ignite/handlers/checkpoint.py:16: DeprecationWarning: `TorchScript` support for functional optimizers is deprecated and will be removed in a future PyTorch release. Consider using the `torch.compile` optimizer instead.
  from torch.distributed.optim import ZeroRedundancyOptimizer
/usr/local/lib/python3.10/dist-packages/modelopt/torch/quantization/tensor_quant.py:92: FutureWarning: `torch.library.impl_abstract` was renamed to `torch.library.register_fake`. Please use that instead; we will remove `torch.library.impl_abstract` in a future version of PyTorch.
  scaled_e4m3_abstract = torch.library.impl_abstract("trt::quantize_fp8")(
WARNING:py.warnings:`np.bool8` is a deprecated alias for `np.bool_`.  (Deprecated NumPy 1.24)

WARNING:py.warnings:`np.object0` is a deprecated alias for ``np.object0` is a deprecated alias for `np.object_`. `object` can be used instead.  (Deprecated NumPy 1.24)`.  (Deprecated NumPy 1.24)

WARNING:py.warnings:`np.int0` is a deprecated alias for `np.intp`.  (Deprecated NumPy 1.24)

WARNING:py.warnings:`np.uint0` is a deprecated alias for `np.uintp`.  (Deprecated NumPy 1.24)

WARNING:py.warnings:`np.void0` is a deprecated alias for `np.void`.  (Deprecated NumPy 1.24)

WARNING:py.warnings:`np.bytes0` is a deprecated alias for `np.bytes_`.  (Deprecated NumPy 1.24)

WARNING:py.warnings:`np.str0` is a deprecated alias for `np.str_`.  (Deprecated NumPy 1.24)

WARNING:py.warnings:Implicitly cleaning up <TemporaryDirectory '/tmp/tmpwhzwfrqi'>

Activity

  1. KumoLiu commented on Sep 4, 2024

    @KumoLiu
    ContributorAuthor

    Some new warning:

    WARNING:py.warnings:pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    
    WARNING:py.warnings:Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.7/migration/
    
    WARNING:py.warnings:Pydantic V1 style `@root_validator` validators are deprecated. You should migrate to Pydantic V2 style `@model_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.7/migration/
    
    WARNING:py.warnings:Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.7/migration/
    
    WARNING:torch_tensorrt.dynamo.conversion.aten_ops_converters:Unable to import quantization op. Please install modelopt library (https://github.com/NVIDIA/TensorRT-Model-Optimizer?tab=readme-ov-file#installation) to add support for compiling quantized models
    
    WARNING:py.warnings:Implicitly cleaning up <TemporaryDirectory '/tmp/tmpi_trmfs_'>
    
  2. ericspod commented on Mar 31, 2025

    @ericspod
    Member

    Hi @KumoLiu are these still current warnings that we need to look at? I think the Numpy related ones are obsolete now.

  3. KumoLiu commented on Apr 1, 2025

    @KumoLiu
    ContributorAuthor

    Hi @ericspod, in this PR I've suppressed these warnings, so it should be fine for now. Since these warnings are not originating from the MONAI core itself, let's keep the suppression as it is for now. What do you think? We can close this ticket or leave it as a reminder. Both should be fine to me.

    # TODO: remove this workaround after upstream fixed the warning

  4. ericspod commented on Apr 9, 2025

    @ericspod
    Member

    I think we leave things as they are with the warnings suppressed and we will revisit this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions