open-mmlab / mmselfsup

OpenMMLab Self-Supervised Learning Toolbox and Benchmark
https://mmselfsup.readthedocs.io/en/latest/
Apache License 2.0
3.14k stars 427 forks source link

MMSelfSup colab giving AssertionError: MMEngine==0.4.0 is used but incompatible with 1.x version #707

Open letdivedeep opened 1 year ago

letdivedeep commented 1 year ago

Branch

1.x branch (1.x version, such as v1.0.0rc2, or dev-1.x branch)

Prerequisite

Environment

root@fbdf77cec3bf:/mmselfsup# python mmselfsup/utils/collect_env.py
sys.platform: linux
Python: 3.7.11 (default, Jul 27 2021, 14:32:16) [GCC 7.5.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0: NVIDIA A10G
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 11.3, V11.3.109
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.12.1+cu113
PyTorch compiling details: PyTorch built with:
  - GCC 9.3
  - C++ Version: 201402
  - Intel(R) oneAPI Math Kernel Library Version 2021.3-Product Build 20210617 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.6.0 (Git Hash 52b5f107dd9cf10910aaa19cb47f3abf9b349815)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - LAPACK is enabled (usually provided by MKL)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 11.3
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86
  - CuDNN 8.3.2  (built against CUDA 11.5)
  - Magma 2.5.2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.3.2, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -fabi-version=11 -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.12.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=OFF, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, 

TorchVision: 0.13.1+cu113
OpenCV: 4.7.0
MMEngine: 0.4.0
MMCV: 2.0.0rc4
MMCV Compiler: GCC 7.5
MMCV CUDA Compiler: 11.3
MMSelfSup: 1.0.0rc6+6c13b42

Describe the bug

Not able to run the provided colab notebook. Have attached the demo notebook. which gives issues while running the model training as

AssertionError                            Traceback (most recent call last)
/tmp/ipykernel_6424/394836790.py in <module>
      6 # register all modules in mmselfsup into the registries
      7 # do not init the default scope here because it will be init in the runner
----> 8 register_all_modules(init_default_scope=False)
      9 
     10 # build the runner from config

/mmselfsup/mmselfsup/utils/setup_env.py in register_all_modules(init_default_scope)
     19     """  # noqa
     20     import mmselfsup.datasets  # noqa: F401,F403
---> 21     import mmselfsup.engine  # noqa: F401,F403
     22     import mmselfsup.evaluation  # noqa: F401,F403
     23     import mmselfsup.models  # noqa: F401,F403

/mmselfsup/mmselfsup/engine/__init__.py in <module>
      1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .hooks import *  # noqa: F401, F403
      3 from .optimizers import *  # noqa: F401, F403

/mmselfsup/mmselfsup/engine/hooks/__init__.py in <module>
      1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .deepcluster_hook import DeepClusterHook
      3 from .densecl_hook import DenseCLHook
      4 from .odc_hook import ODCHook
      5 from .simsiam_hook import SimSiamHook

/mmselfsup/mmselfsup/engine/hooks/deepcluster_hook.py in <module>
      9 from mmengine.logging import print_log
     10 
---> 11 from mmselfsup.models.utils import Extractor
     12 from mmselfsup.registry import HOOKS
     13 from mmselfsup.utils import clustering as _clustering

/mmselfsup/mmselfsup/models/__init__.py in <module>
      1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .algorithms import *  # noqa: F401,F403
      3 from .backbones import *  # noqa: F401,F403
      4 from .builder import (ALGORITHMS, BACKBONES, HEADS, LOSSES, MEMORIES, NECKS,
      5                       build_algorithm, build_backbone, build_head, build_loss,

/mmselfsup/mmselfsup/models/algorithms/__init__.py in <module>
      3 from .base import BaseModel
      4 from .beit import BEiT
----> 5 from .byol import BYOL
      6 from .cae import CAE
      7 from .deepcluster import DeepCluster

/mmselfsup/mmselfsup/models/algorithms/byol.py in <module>
      7 from mmselfsup.registry import MODELS
      8 from mmselfsup.structures import SelfSupDataSample
----> 9 from ..utils import CosineEMA
     10 from .base import BaseModel
     11 

/mmselfsup/mmselfsup/models/utils/__init__.py in <module>
     20 
     21 try:
---> 22     from .res_layer_extra_norm import ResLayerExtraNorm
     23 except ImportError:
     24     ResLayerExtraNorm = None

/mmselfsup/mmselfsup/models/utils/res_layer_extra_norm.py in <module>
      3 
      4 try:
----> 5     from mmdet.models.backbones import ResNet
      6     from mmdet.models.builder import SHARED_HEADS
      7     from mmdet.models.roi_heads.shared_heads.res_layer import ResLayer

/opt/conda/lib/python3.7/site-packages/mmdet/__init__.py in <module>
     21 assert (mmengine_version >= digit_version(mmengine_minimum_version)
     22         and mmengine_version < digit_version(mmengine_maximum_version)), \
---> 23     f'MMEngine=={mmengine.__version__} is used but incompatible. ' \
     24     f'Please install mmengine>={mmengine_minimum_version}, ' \
     25     f'<{mmengine_maximum_version}.'

AssertionError: MMEngine==0.4.0 is used but incompatible. Please install mmengine>=0.6.0, <1.0.0.

mmselfsup_colab_tutorial.ipynb.zip

Reproduces the problem - code sample

No response

Reproduces the problem - command or script

No response

Reproduces the problem - error message

No response

Additional information

No response

YuanLiuuuuuu commented 1 year ago

you can use following command to upgrate mmengine to >=0.6.0:

! pip install mmengine>=0.6.0
letdivedeep commented 1 year ago

@YuanLiuuuuuu Thanks for your response. I ran the above command by which I was able to resolve the issue. But this was all working with a torch version of

1.12.1+cu113

And I want to run this with a torch version 1.10.0

when I updated the pytorch version to 1.10.0, on the same notebook I started getting issues while starting the training

AssertionError                            Traceback (most recent call last)
/tmp/ipykernel_3910/394836790.py in <module>
      6 # register all modules in mmselfsup into the registries
      7 # do not init the default scope here because it will be init in the runner
----> 8 register_all_modules(init_default_scope=False)
      9 
     10 # build the runner from config

/mmselfsup/mmselfsup/utils/setup_env.py in register_all_modules(init_default_scope)
     19     """  # noqa
     20     import mmselfsup.datasets  # noqa: F401,F403
---> 21     import mmselfsup.engine  # noqa: F401,F403
     22     import mmselfsup.evaluation  # noqa: F401,F403
     23     import mmselfsup.models  # noqa: F401,F403

/mmselfsup/mmselfsup/engine/__init__.py in <module>
      1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .hooks import *  # noqa: F401, F403
      3 from .optimizers import *  # noqa: F401, F403

/mmselfsup/mmselfsup/engine/hooks/__init__.py in <module>
      1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .deepcluster_hook import DeepClusterHook
      3 from .densecl_hook import DenseCLHook
      4 from .odc_hook import ODCHook
      5 from .simsiam_hook import SimSiamHook

/mmselfsup/mmselfsup/engine/hooks/deepcluster_hook.py in <module>
      9 from mmengine.logging import print_log
     10 
---> 11 from mmselfsup.models.utils import Extractor
     12 from mmselfsup.registry import HOOKS
     13 from mmselfsup.utils import clustering as _clustering

/mmselfsup/mmselfsup/models/__init__.py in <module>
      1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .algorithms import *  # noqa: F401,F403
      3 from .backbones import *  # noqa: F401,F403
      4 from .builder import (ALGORITHMS, BACKBONES, HEADS, LOSSES, MEMORIES, NECKS,
      5                       build_algorithm, build_backbone, build_head, build_loss,

/mmselfsup/mmselfsup/models/algorithms/__init__.py in <module>
      3 from .base import BaseModel
      4 from .beit import BEiT
----> 5 from .byol import BYOL
      6 from .cae import CAE
      7 from .deepcluster import DeepCluster

/mmselfsup/mmselfsup/models/algorithms/byol.py in <module>
      7 from mmselfsup.registry import MODELS
      8 from mmselfsup.structures import SelfSupDataSample
----> 9 from ..utils import CosineEMA
     10 from .base import BaseModel
     11 

/mmselfsup/mmselfsup/models/utils/__init__.py in <module>
     20 
     21 try:
---> 22     from .res_layer_extra_norm import ResLayerExtraNorm
     23 except ImportError:
     24     ResLayerExtraNorm = None

/mmselfsup/mmselfsup/models/utils/res_layer_extra_norm.py in <module>
      3 
      4 try:
----> 5     from mmdet.models.backbones import ResNet
      6     from mmdet.models.builder import SHARED_HEADS
      7     from mmdet.models.roi_heads.shared_heads.res_layer import ResLayer

/opt/conda/lib/python3.7/site-packages/mmdet/__init__.py in <module>
     24 assert (mmcv_version >= digit_version(mmcv_minimum_version)
     25         and mmcv_version <= digit_version(mmcv_maximum_version)), \
---> 26     f'MMCV=={mmcv.__version__} is used but incompatible. ' \
     27     f'Please install mmcv>={mmcv_minimum_version}, <={mmcv_maximum_version}.'
     28 

AssertionError: MMCV==2.0.0rc4 is used but incompatible. Please install mmcv>=1.3.17, <=1.8.0.

Can you help me know if 1.x version work with torch 1.10, have attached the notebook mmselfsup_colab_tutorial_pytorch1-10.ipynb.zip

letdivedeep commented 1 year ago

@YuanLiuuuuuu 1.x can work with pytorch 1.10

YuanLiuuuuuu commented 1 year ago

Did you solve this problem?

letdivedeep commented 1 year ago

Did you solve this problem?

No @YuanLiuuuuuu, I was not able to solve the above problem, so just wanted to check if 1.x works with pytorch 1.10 ... As in the notebook I am trying to build using the same pytorch version

letdivedeep commented 1 year ago

@YuanLiuuuuuu were you able to reproduce the issue ?