is this library no longer maintained.
Is this the end of MMLAB,there is no new instance seg/detection model except the grounding DINO one most issues are left unresolved ,certificate expired,adding suppot for newer libraries and higher res images. I mean given the vast research in high res images now days you would think there would be some models or support for that.
Hey OpenMMLab community! 👋 We've updated 7 core repos (MMDetection, MMSegmentation, and others) to work with the latest PyTorch and made them production-ready for our AI platform.
We're committed to maintaining these repos going forward and encourage you to contribute features through pull requests.
Check them out if you need PyTorch compatibility: https://github.com/VBTI-development— feedback welcome!
@lauriebax 404 page not found
Oops, copy/paste error with the link. It should work now.
thanks does ondl work on current colab environment.right now i have to switch to python 3.11 to get torch 2.1
We've not tested it specifically, but the interface and imports have not changed. Instead of installing openmim you should use onedl-mim and then mim install onedl-mmdetection and the rest of the notebook should just work. We have adapted the notebook in our repo, but did not attach a colab space to it.
i tested it right now on running the below commands !pip install -U openmim !mim install "mmengine>=0.7.0" !mim install "mmcv>=2.0.0rc4" I am getting the error invalid pk g ImpImporter error,which happens when you are on latest pytorch and python versions.
You have to use !pip install -U onedl-mim !mim install "onedl-mmengine>=0.7.0" !mim install "onedl-mmcv>=2.0.0rc4"
Hopefully that will do the trick.
this is the error i am getting
Traceback (most recent call last):
File "/usr/local/bin/mim", line 5, in <module>
from mim.cli import cli
File "/usr/local/lib/python3.12/dist-packages/mim/__init__.py", line 10, in <module>
import setuptools # noqa: F401
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/setuptools/__init__.py", line 16, in <module>
import setuptools.version
File "/usr/local/lib/python3.12/dist-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/usr/local/lib/python3.12/dist-packages/pkg_resources/__init__.py", line 2172, in <module>
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
/bin/bash: -c: line 1: unexpected EOF while looking for matching `"'
/bin/bash: -c: line 2: syntax error: unexpected end of file
i already faced this i think this is probably due to mmcv still not working properly on latest python versions,it can be solved when we downgrade python to 3.11.3 and torch to 2.1
Hello!
I am interested in testing your fork OpenDL-Detection, but I am having some errors.
Currently, I am using a Google Colab environment with an A100 GPU.
I set up the Colab environment to use Python 3.11.13.
I have installed the following version of Pytorch: !pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118
After that, I installed the following packages:
%pip install -U onedl-mim
!mim install "onedl-mmengine>=0.7.0"
!mim install "onedl-mmcv>=2.0.0rc4"
So I cloned the opendl-mmdetection repository and performed the installation:
!git clone https://github.com/vbti-development/onedl-mmdetection.git
%cd onedl-mmdetection
!pip install -v -e .
Finally, I tried running the demo to check if everything was correct:
!python demo/image_demo.py demo/demo.jpg \
configs/rtmdet/rtmdet_l_8xb32-300e_coco.py \
--weights checkpoints/rtmdet_l_8xb32-300e_coco_20220719_112030-5a0be7c4.pth \
--device cuda
However, I received the following error.
Could not import OneDL
Traceback (most recent call last):
File "/content/onedl-mmdetection/demo/image_demo.py", line 63, in <module>
from mmdet.apis import DetInferencer
File "/content/onedl-mmdetection/mmdet/apis/__init__.py", line 2, in <module>
from .det_inferencer import DetInferencer
File "/content/onedl-mmdetection/mmdet/apis/det_inferencer.py", line 22, in <module>
from mmdet.evaluation import INSTANCE_OFFSET
File "/content/onedl-mmdetection/mmdet/evaluation/__init__.py", line 4, in <module>
from .metrics import * # noqa: F401,F403
^^^^^^^^^^^^^^^^^^^^^^
File "/content/onedl-mmdetection/mmdet/evaluation/metrics/__init__.py", line 5, in <module>
from .coco_metric import CocoMetric
File "/content/onedl-mmdetection/mmdet/evaluation/metrics/coco_metric.py", line 16, in <module>
from mmdet.datasets.api_wrappers import COCO, COCOeval, COCOevalMP
File "/content/onedl-mmdetection/mmdet/datasets/__init__.py", line 43, in <module>
from .utils import get_loading_pipeline
File "/content/onedl-mmdetection/mmdet/datasets/utils.py", line 5, in <module>
from mmdet.datasets.transforms import LoadAnnotations, LoadPanopticAnnotations
File "/content/onedl-mmdetection/mmdet/datasets/transforms/__init__.py", line 6, in <module>
from .formatting import (ImageToTensor, PackDetInputs, PackReIDInputs,
File "/content/onedl-mmdetection/mmdet/datasets/transforms/formatting.py", line 11, in <module>
from mmdet.structures.bbox import BaseBoxes
File "/content/onedl-mmdetection/mmdet/structures/bbox/__init__.py", line 2, in <module>
from .base_boxes import BaseBoxes
File "/content/onedl-mmdetection/mmdet/structures/bbox/base_boxes.py", line 9, in <module>
from mmdet.structures.mask.structures import BitmapMasks, PolygonMasks
File "/content/onedl-mmdetection/mmdet/structures/mask/__init__.py", line 3, in <module>
from .structures import (BaseInstanceMasks, BitmapMasks, PolygonMasks,
File "/content/onedl-mmdetection/mmdet/structures/mask/structures.py", line 12, in <module>
from mmcv.ops.roi_align import roi_align
File "/usr/local/lib/python3.11/dist-packages/mmcv/ops/__init__.py", line 3, in <module>
from .active_rotated_filter import active_rotated_filter
File "/usr/local/lib/python3.11/dist-packages/mmcv/ops/active_rotated_filter.py", line 10, in <module>
ext_module = ext_loader.load_ext(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
ext = importlib.import_module('mmcv.' + name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'mmcv._ext'
@psantiago-lsbd that is because you are using a onedl-mmcv version without binaries. It doesn not have the extensions installed. You need to either 1. build onedl-mmcv yourself or 2. upgrade to pytorch 2.4 or 2.5 to use a prebuilt wheel (all available wheels can be found here). If pytorch 2.1 is requested a lot we can add it to our prebuilt wheelhouse.
@sparshgarg23 I see it indeed does not work with python 3.12. I will look into it.
@lauriebax is there any support needed for this prebuilt wheelhouse?
In general I am having lots of reproducibility issues for myself and my team, I'm happy to offer help in:
- Supporting the CI infrastructure to generate the wheel for the index?
- Supporting the CI infrastructure to generate and publish Docker images that have all the dependencies ready
- Supporting any PyPI index work, e.g. copying Sentry (uses https://github.com/chriskuehl/dumb-pypi) to make a public index
@adehad Cool. We currently built a limited number of wheels for mmcv and publish them at https://mmwheels.onedl.ai/, is that what you mean with 3?
We are also setting up publishing docker images for MMDeploy. We are definitely open to publishing more docker images so if you could support by providing Dockerfiles and proposals on the CI side that would be amazing!
@lauriebax
We currently built a limited number of wheels for mmcv and publish them at https://mmwheels.onedl.ai/, is that what you mean with 3?
Yes that is great. Getting each of the binaries build for the pytorch and cuda versions would be great. Ideally we would want to make significant improvements to the project configuration to make this as easy as pytorch's strategy. This would involve: using a pytorch dependency pin (e.g. torch==2.4.*) in the python specifier, so pip can then find the right version of mmlab package for the user's pytorch without needing a specific URL.
This could make the install command: pip install mmcv==2.2.0+cu121 -f https://mmwheels.onedl.ai/ (and the user only needs to change the CUDA specifier and not the main URL anymore)
We are also setting up publishing docker images for MMDeploy. We are definitely open to publishing more docker images so if you could support by providing Dockerfiles and proposals on the CI side that would be amazing!
That's good! Having the wheels will make it easier to make the Dockerfiles. Solving the wheel problem will translate well to the docker files.
My suggestion for the Dockerfile will be to use a pyproject.toml and paired lock file to specify the dependencies used when building. A rough example (where I forced it to work) is how it is done here: https://github.com/mutedeparture/rtmpose3d/pull/2 . Users who then use the docker image can then also use the lock file as a starter for their project which they can add their own dependencies for their use cases.
@adehad Let's continue our discussion here
I am currently working on my own experiment.While i was able to get the main library running after downgrading i noticed something curious. In order to get it working you also need to downgrade python to 3.11.3,then torch to 2.1 with cuda 12.1,numpy is downgraded to 1.26.4,and then you can do mim install mmcv>=2.0.0rc4 <2.2.0.
However there is a catch you can run demo scripts/training,inference/log analysis by calling the individual scripts,train.py demo.py etc.But when you do something like the examples shown below,you get a numpy mismatch error.Not sure why?
from mmcv.ops import get_compiling_cuda_version, get_compiler_version
print("CUDA version:", get_compiling_cuda_version())
print("Compiler version:", get_compiler_version())
Output
/usr/local/lib/python3.11/dist-packages/torch/distributed/_functional_collectives.py:22: UserWarning: Unable to import torchdynamo util `is_torchdynamo_compiling`, so won't support torchdynamo correctly
warnings.warn(
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/tmp/ipython-input-4-4774532.py in <cell line: 0>()
----> 1 from mmcv.ops import get_compiling_cuda_version, get_compiler_version
2 print("CUDA version:", get_compiling_cuda_version())
3 print("Compiler version:", get_compiler_version())
20 frames/usr/local/lib/python3.11/dist-packages/mmcv/ops/__init__.py in <module>
10 from .box_iou_quadri import box_iou_quadri
11 from .box_iou_rotated import box_iou_rotated
---> 12 from .carafe import CARAFE, CARAFENaive, CARAFEPack, carafe, carafe_naive
13 from .cc_attention import CrissCrossAttention
14 from .chamfer_distance import chamfer_distance
/usr/local/lib/python3.11/dist-packages/mmcv/ops/carafe.py in <module>
5 import torch.nn as nn
6 import torch.nn.functional as F
----> 7 from mmengine.model import normal_init, xavier_init
8 from mmengine.registry import MODELS
9 from torch import Tensor
/usr/local/lib/python3.11/dist-packages/mmengine/model/__init__.py in <module>
4 from .averaged_model import (BaseAveragedModel, ExponentialMovingAverage,
5 MomentumAnnealingEMA, StochasticWeightAverage)
----> 6 from .base_model import BaseDataPreprocessor, BaseModel, ImgDataPreprocessor
7 from .base_module import BaseModule, ModuleDict, ModuleList, Sequential
8 from .test_time_aug import BaseTTAModel
/usr/local/lib/python3.11/dist-packages/mmengine/model/base_model/__init__.py in <module>
1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .base_model import BaseModel
3 from .data_preprocessor import BaseDataPreprocessor, ImgDataPreprocessor
4
5 __all__ = ['BaseModel', 'ImgDataPreprocessor', 'BaseDataPreprocessor']
/usr/local/lib/python3.11/dist-packages/mmengine/model/base_model/base_model.py in <module>
7 import torch.nn as nn
8
----> 9 from mmengine.optim import OptimWrapper
10 from mmengine.registry import MODELS
11 from mmengine.utils import is_list_of
/usr/local/lib/python3.11/dist-packages/mmengine/optim/__init__.py in <module>
1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .optimizer import (OPTIM_WRAPPER_CONSTRUCTORS, OPTIMIZERS,
3 AmpOptimWrapper, ApexOptimWrapper, BaseOptimWrapper,
4 DefaultOptimWrapperConstructor, OptimWrapper,
5 OptimWrapperDict, ZeroRedundancyOptimizer,
/usr/local/lib/python3.11/dist-packages/mmengine/optim/optimizer/__init__.py in <module>
8 from .optimizer_wrapper import OptimWrapper
9 from .optimizer_wrapper_dict import OptimWrapperDict
---> 10 from .zero_optimizer import ZeroRedundancyOptimizer
11
12 __all__ = [
/usr/local/lib/python3.11/dist-packages/mmengine/optim/optimizer/zero_optimizer.py in <module>
9
10 try:
---> 11 from torch.distributed.optim import \
12 ZeroRedundancyOptimizer as _ZeroRedundancyOptimizer
13 except ImportError:
/usr/local/lib/python3.11/dist-packages/torch/distributed/optim/__init__.py in <module>
22 from .functional_rprop import _FunctionalRprop
23 from .functional_sgd import _FunctionalSGD
---> 24 from .named_optimizer import _NamedOptimizer
25 from .utils import as_functional_optim
26
/usr/local/lib/python3.11/dist-packages/torch/distributed/optim/named_optimizer.py in <module>
9 from torch import optim
10 from torch.distributed._shard.sharded_tensor import ShardedTensor
---> 11 from torch.distributed.fsdp import FullyShardedDataParallel as FSDP
12
13
/usr/local/lib/python3.11/dist-packages/torch/distributed/fsdp/__init__.py in <module>
----> 1 from .flat_param import FlatParameter
2 from .fully_sharded_data_parallel import (
3 BackwardPrefetch,
4 CPUOffload,
5 FullOptimStateDictConfig,
/usr/local/lib/python3.11/dist-packages/torch/distributed/fsdp/flat_param.py in <module>
28 import torch.nn.functional as F
29 from torch import Tensor
---> 30 from torch.distributed.fsdp._common_utils import (
31 _FSDPDeviceHandle,
32 _named_parameters_with_duplicates,
/usr/local/lib/python3.11/dist-packages/torch/distributed/fsdp/_common_utils.py in <module>
29 import torch.nn as nn
30 from torch.distributed._composable_state import _get_module_state, _State
---> 31 from torch.distributed._tensor.device_mesh import DeviceMesh
32 from torch.distributed.algorithms._checkpoint.checkpoint_wrapper import (
33 _CHECKPOINT_PREFIX,
/usr/local/lib/python3.11/dist-packages/torch/distributed/_tensor/__init__.py in <module>
317
318 if not torch._running_with_deploy():
--> 319 import torch.distributed._tensor._dynamo_utils
/usr/local/lib/python3.11/dist-packages/torch/distributed/_tensor/_dynamo_utils.py in <module>
----> 1 from torch._dynamo import allow_in_graph
2 from torch.distributed._tensor.api import DTensor
3
4 # dynamo/torch.compile utils for
5 allow_in_graph(DTensor)
/usr/local/lib/python3.11/dist-packages/torch/_dynamo/__init__.py in <module>
1 import torch
----> 2 from . import allowed_functions, convert_frame, eval_frame, resume_execution
3 from .backends.registry import list_backends, register_backend
4 from .convert_frame import replay
5 from .decorators import (
/usr/local/lib/python3.11/dist-packages/torch/_dynamo/allowed_functions.py in <module>
24 from . import config
25 from .external_utils import is_compiling
---> 26 from .utils import is_safe_constant, NP_SUPPORTED_MODULES
27
28 """
/usr/local/lib/python3.11/dist-packages/torch/_dynamo/utils.py in <module>
42 # NOTE: Make sure `NP_SUPPORTED_MODULES` and `NP_TO_TNP_MODULE` are in sync.
43 if np:
---> 44 NP_SUPPORTED_MODULES = (np, np.fft, np.linalg, np.random)
45
46 NP_TO_TNP_MODULE = {
/usr/local/lib/python3.11/dist-packages/numpy/__init__.py in __getattr__(attr)
335
336 def __dir__():
--> 337 public_symbols = globals().keys() | {'testing'}
338 public_symbols -= {
339 "core", "matrixlib",
/usr/local/lib/python3.11/dist-packages/numpy/random/__init__.py in <module>
178
179 # add these for module-freeze analysis (like PyInstaller)
--> 180 from . import _pickle
181 from . import _common
182 from . import _bounded_integers
/usr/local/lib/python3.11/dist-packages/numpy/random/_pickle.py in <module>
----> 1 from .mtrand import RandomState
2 from ._philox import Philox
3 from ._pcg64 import PCG64, PCG64DXSM
4 from ._sfc64 import SFC64
5
numpy/random/mtrand.pyx in init numpy.random.mtrand()
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
@sparshgarg23 I don't know if you've already seen it but we have now prebuilt wheels for python 3.12 so using onedl-mmdetection on Colab should be easier now (also should work with both numpy 1 and 2).
thanks @lauriebax i will look into this when i resume work.Also does onedl support mmsegmentation as well?I can look into it and see if there are any changes or bugs in that as well for latest python versions.
Yes, we also support onedl-mmsegmentation . If you can look into that, it would be amazing.