Project-MONAI / Project-MONAI/MONAI

type object 'FileOptions' has no attribute 'RegisterExtension' in mlflow

Open
#7,658 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dependencies
Dominant language
Python
Stars
8.7k
Forks
1.6k
Avg merge
5d 1h
Merged PRs (30d)
20

Description


[2024-04-17T01:04:36.169Z] ======================================================================

[2024-04-17T01:04:36.169Z] ERROR: test_multi_run (tests.test_handler_mlflow.TestHandlerMLFlow)

[2024-04-17T01:04:36.169Z] ----------------------------------------------------------------------

[2024-04-17T01:04:36.169Z] Traceback (most recent call last):

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/tests/test_handler_mlflow.py", line 97, in test_multi_run

[2024-04-17T01:04:36.169Z]     handler = MLFlowHandler(

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/handlers/mlflow_handler.py", line 154, in __init__

[2024-04-17T01:04:36.169Z]     self.client = mlflow.MlflowClient(tracking_uri=tracking_uri if tracking_uri else None)

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/utils/module.py", line 441, in __getattr__

[2024-04-17T01:04:36.169Z]     raise self._exception

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 60, in testPartExecutor

[2024-04-17T01:04:36.169Z]     yield

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 676, in run

[2024-04-17T01:04:36.169Z]     self._callTestMethod(testMethod)

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 633, in _callTestMethod

[2024-04-17T01:04:36.169Z]     method()

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/site-packages/parameterized/parameterized.py", line 620, in standalone_func

[2024-04-17T01:04:36.169Z]     return func(*(a + p.args), **p.kwargs, **kw)

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/tests/test_handler_mlflow.py", line 168, in test_metrics_track_mock

[2024-04-17T01:04:36.169Z]     handler = MLFlowHandler(

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/handlers/mlflow_handler.py", line 154, in __init__

[2024-04-17T01:04:36.169Z]     self.client = mlflow.MlflowClient(tracking_uri=tracking_uri if tracking_uri else None)

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/utils/module.py", line 441, in __getattr__

[2024-04-17T01:04:36.169Z]     raise self._exception

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 60, in testPartExecutor

[2024-04-17T01:04:36.169Z]     yield

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 676, in run

[2024-04-17T01:04:36.169Z]     self._callTestMethod(testMethod)

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 633, in _callTestMethod

[2024-04-17T01:04:36.169Z]     method()

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/site-packages/parameterized/parameterized.py", line 620, in standalone_func

[2024-04-17T01:04:36.169Z]     return func(*(a + p.args), **p.kwargs, **kw)

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/tests/test_handler_mlflow.py", line 168, in test_metrics_track_mock

[2024-04-17T01:04:36.169Z]     handler = MLFlowHandler(

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/handlers/mlflow_handler.py", line 154, in __init__

[2024-04-17T01:04:36.169Z]     self.client = mlflow.MlflowClient(tracking_uri=tracking_uri if tracking_uri else None)

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/utils/module.py", line 441, in __getattr__

[2024-04-17T01:04:36.169Z]     raise self._exception

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 60, in testPartExecutor

[2024-04-17T01:04:36.169Z]     yield

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 676, in run

[2024-04-17T01:04:36.169Z]     self._callTestMethod(testMethod)

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 633, in _callTestMethod

[2024-04-17T01:04:36.169Z]     method()

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/site-packages/parameterized/parameterized.py", line 620, in standalone_func

[2024-04-17T01:04:36.169Z]     return func(*(a + p.args), **p.kwargs, **kw)

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/tests/test_handler_mlflow.py", line 207, in test_metrics_track_iters_mock

[2024-04-17T01:04:36.169Z]     handler = MLFlowHandler(

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/handlers/mlflow_handler.py", line 154, in __init__

[2024-04-17T01:04:36.169Z]     self.client = mlflow.MlflowClient(tracking_uri=tracking_uri if tracking_uri else None)

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/utils/module.py", line 441, in __getattr__

[2024-04-17T01:04:36.169Z]     raise self._exception

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 60, in testPartExecutor

[2024-04-17T01:04:36.169Z]     yield

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 676, in run

[2024-04-17T01:04:36.169Z]     self._callTestMethod(testMethod)

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 633, in _callTestMethod

[2024-04-17T01:04:36.169Z]     method()

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/site-packages/parameterized/parameterized.py", line 620, in standalone_func

[2024-04-17T01:04:36.169Z]     return func(*(a + p.args), **p.kwargs, **kw)

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/tests/test_handler_mlflow.py", line 207, in test_metrics_track_iters_mock

[2024-04-17T01:04:36.169Z]     handler = MLFlowHandler(

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/handlers/mlflow_handler.py", line 154, in __init__

[2024-04-17T01:04:36.169Z]     self.client = mlflow.MlflowClient(tracking_uri=tracking_uri if tracking_uri else None)

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/utils/module.py", line 441, in __getattr__

[2024-04-17T01:04:36.169Z]     raise self._exception

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 60, in testPartExecutor

[2024-04-17T01:04:36.169Z]     yield

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 676, in run

[2024-04-17T01:04:36.169Z]     self._callTestMethod(testMethod)

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/unittest/case.py", line 633, in _callTestMethod

[2024-04-17T01:04:36.169Z]     method()

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/tests/test_handler_mlflow.py", line 134, in test_metrics_track

[2024-04-17T01:04:36.169Z]     handler = MLFlowHandler(

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/handlers/mlflow_handler.py", line 154, in __init__

[2024-04-17T01:04:36.169Z]     self.client = mlflow.MlflowClient(tracking_uri=tracking_uri if tracking_uri else None)

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/utils/module.py", line 441, in __getattr__

[2024-04-17T01:04:36.169Z]     raise self._exception

[2024-04-17T01:04:36.169Z]   File "/home/jenkins/agent/workspace/Monai-pytorch-versions/monai/utils/module.py", line 399, in optional_import

[2024-04-17T01:04:36.169Z]     pkg = __import__(module)  # top level module

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/site-packages/mlflow/__init__.py", line 34, in <module>

[2024-04-17T01:04:36.169Z]     from mlflow import (

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/site-packages/mlflow/artifacts/__init__.py", line 9, in <module>

[2024-04-17T01:04:36.169Z]     from mlflow.exceptions import MlflowException

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/site-packages/mlflow/exceptions.py", line 4, in <module>

[2024-04-17T01:04:36.169Z]     from mlflow.protos.databricks_pb2 import (

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/site-packages/mlflow/protos/databricks_pb2.py", line 17, in <module>

[2024-04-17T01:04:36.169Z]     from .scalapb import scalapb_pb2 as scalapb_dot_scalapb__pb2

[2024-04-17T01:04:36.169Z]   File "/opt/conda/lib/python3.8/site-packages/mlflow/protos/scalapb/scalapb_pb2.py", line 53, in <module>

[2024-04-17T01:04:36.169Z]     google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(options)

[2024-04-17T01:04:36.169Z] monai.utils.module.OptionalImportError: Please install mlflow before using MLFlowHandler. (type object 'FileOptions' has no attribute 'RegisterExtension').

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MLFlowHandler initialization in monai/handlers/mlflow_handler.py and reproduce the import failure through tests/test_handler_mlflow.py. Trace the dependency error shown for mlflow/protos/scalapb/scalapb_pb2.py, then verify that the MLFlowHandler tests initialize successfully without the reported OptionalImportError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.