Skip to content

Conversation

amadeuszsz
Copy link
Collaborator

Summary

Update core dependencies.

Note

Test performed

@amadeuszsz amadeuszsz requested a review from KSeangTan October 6, 2025 11:10
@amadeuszsz amadeuszsz self-assigned this Oct 6, 2025
Copy link
Collaborator

@KSeangTan KSeangTan left a comment

Choose a reason for hiding this comment

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

LGTM!

@vividf
Copy link
Collaborator

vividf commented Oct 7, 2025

@amadeuszsz
Seems that the mmdet version is not compatible with mmcv=2.2.0

Traceback (most recent call last): File "/workspace/projects/CalibrationStatusClassification/deploy/main.py", line 38, in <module> from autoware_ml.calibration_classification.datasets.transforms.calibration_classification_transform import ( File "/workspace/autoware_ml/__init__.py", line 3, in <module> import mmdet File "/opt/conda/lib/python3.11/site-packages/mmdet/__init__.py", line 16, in <module> assert (mmcv_version >= digit_version(mmcv_minimum_version) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: MMCV==2.2.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.2.0. root@66c4ae6d9b78:/workspace# ^C root@66c4ae6d9b78:/workspace# ^C root@66c4ae6d9b78:/workspace# python projects/CalibrationStatusClassification/deploy/main.py projects/CalibrationStatusClassification/configs/deploy/resnet18_5ch.py projects/CalibrationStatusClassification/configs/t4dataset/resnet18_5ch_1xb16-50e_j6gen2.py Traceback (most recent call last): File "/workspace/projects/CalibrationStatusClassification/deploy/main.py", line 38, in <module> from autoware_ml.calibration_classification.datasets.transforms.calibration_classification_transform import ( File "/workspace/autoware_ml/__init__.py", line 3, in <module> import mmdet File "/opt/conda/lib/python3.11/site-packages/mmdet/__init__.py", line 16, in <module> assert (mmcv_version >= digit_version(mmcv_minimum_version) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: MMCV==2.2.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.2.0.

@vividf vividf self-requested a review October 7, 2025 07:19
Signed-off-by: Amadeusz Szymko <[email protected]>
@amadeuszsz
Copy link
Collaborator Author

@amadeuszsz Seems that the mmdet version is not compatible with mmcv=2.2.0

Traceback (most recent call last): File "/workspace/projects/CalibrationStatusClassification/deploy/main.py", line 38, in <module> from autoware_ml.calibration_classification.datasets.transforms.calibration_classification_transform import ( File "/workspace/autoware_ml/__init__.py", line 3, in <module> import mmdet File "/opt/conda/lib/python3.11/site-packages/mmdet/__init__.py", line 16, in <module> assert (mmcv_version >= digit_version(mmcv_minimum_version) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: MMCV==2.2.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.2.0. root@66c4ae6d9b78:/workspace# ^C root@66c4ae6d9b78:/workspace# ^C root@66c4ae6d9b78:/workspace# python projects/CalibrationStatusClassification/deploy/main.py projects/CalibrationStatusClassification/configs/deploy/resnet18_5ch.py projects/CalibrationStatusClassification/configs/t4dataset/resnet18_5ch_1xb16-50e_j6gen2.py Traceback (most recent call last): File "/workspace/projects/CalibrationStatusClassification/deploy/main.py", line 38, in <module> from autoware_ml.calibration_classification.datasets.transforms.calibration_classification_transform import ( File "/workspace/autoware_ml/__init__.py", line 3, in <module> import mmdet File "/opt/conda/lib/python3.11/site-packages/mmdet/__init__.py", line 16, in <module> assert (mmcv_version >= digit_version(mmcv_minimum_version) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: MMCV==2.2.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.2.0.

@vividf
Good catch! Even though we can probably patch it, I think we don't need so far any feature from 2.2.0. Addressed in 5b10dc5

Copy link
Collaborator

@vividf vividf left a comment

Choose a reason for hiding this comment

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

  File "/opt/conda/lib/python3.11/site-packages/mmengine/runner/runner.py", line 2127, in load_checkpoint
    checkpoint = _load_checkpoint(filename, map_location=map_location)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/mmengine/runner/checkpoint.py", line 548, in _load_checkpoint
    return CheckpointLoader.load_checkpoint(filename, map_location, logger)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/mmengine/runner/checkpoint.py", line 330, in load_checkpoint
    return checkpoint_loader(filename, map_location)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/mmengine/runner/checkpoint.py", line 347, in load_from_local
    checkpoint = torch.load(filename, map_location=map_location)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/torch/serialization.py", line 1529, in load
    raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint. 
	(1) In PyTorch 2.6, we changed the default value of the `weights_only` argument in `torch.load` from `False` to `True`. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
	(2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following error message.
	WeightsUnpickler error: Unsupported global: GLOBAL mmengine.logging.history_buffer.HistoryBuffer was not an allowed global by default. Please use `torch.serialization.add_safe_globals([mmengine.logging.history_buffer.HistoryBuffer])` or the `torch.serialization.safe_globals([mmengine.logging.history_buffer.HistoryBuffer])` context manager to allowlist this global if you trust this class/function.

Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.

I think some additional work needs to be done (trying now)

@amadeuszsz
Copy link
Collaborator Author

  File "/opt/conda/lib/python3.11/site-packages/mmengine/runner/runner.py", line 2127, in load_checkpoint
    checkpoint = _load_checkpoint(filename, map_location=map_location)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/mmengine/runner/checkpoint.py", line 548, in _load_checkpoint
    return CheckpointLoader.load_checkpoint(filename, map_location, logger)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/mmengine/runner/checkpoint.py", line 330, in load_checkpoint
    return checkpoint_loader(filename, map_location)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/mmengine/runner/checkpoint.py", line 347, in load_from_local
    checkpoint = torch.load(filename, map_location=map_location)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/torch/serialization.py", line 1529, in load
    raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint. 
	(1) In PyTorch 2.6, we changed the default value of the `weights_only` argument in `torch.load` from `False` to `True`. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
	(2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following error message.
	WeightsUnpickler error: Unsupported global: GLOBAL mmengine.logging.history_buffer.HistoryBuffer was not an allowed global by default. Please use `torch.serialization.add_safe_globals([mmengine.logging.history_buffer.HistoryBuffer])` or the `torch.serialization.safe_globals([mmengine.logging.history_buffer.HistoryBuffer])` context manager to allowlist this global if you trust this class/function.

Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.

If we used PyTorch 2.6,the mmengine checkpoint loading code needs to be fixed (or maybe updated? checking right now)

@vividf
Right, already noted same issue in PTv3 PR. Looks like we need to patch openmmlab packages. Thanks! I will also update AWML projects which use torch.load.

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