Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytorch 1.10 with CUDA 11.3 is not compatible with MMCV==2.0.0.rc4 #741

Closed
3 tasks done
letdivedeep opened this issue Apr 5, 2023 · 2 comments
Closed
3 tasks done
Assignees
Labels
Bug Something isn't working

Comments

@letdivedeep
Copy link

letdivedeep commented Apr 5, 2023

Branch

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

Prerequisite

Environment

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.10.0
PyTorch compiling details: PyTorch built with:

  • GCC 7.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.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  • 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_61,code=sm_61;-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;-gencode;arch=compute_37,code=compute_37
  • CuDNN 8.2
  • Magma 2.5.2
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.0, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -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-sign-compare -Wno-unused-parameter -Wno-unused-variable -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 -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.10.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

TorchVision: 0.11.0
OpenCV: 4.7.0
MMEngine: 0.6.0
MMCV: 2.0.0rc4
MMCV Compiler: GCC 9.3
MMCV CUDA Compiler: 11.3
MMSelfSup: 1.0.0rc6+6c13b42

Describe the bug

I have an environment with pytorch 1.10.0 and CUDA 11.3, when i try to install the mmselfsup from the 1.x branch through the demo notebook given.

I found when we install a mmcv version of 2.0.0rc4, with mmcls as 1.0.0rc5 and mmselfsup as 1.0.0rc6, we are getting an error saying

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

Screenshot 2023-04-05 at 7 24 33 PM

and when we install the mmcv version as 1.7.1 we get this error at mmcls and mmselfsup

AssertionError: MMCV==1.7.1 is used but incompatible. Please install mmcv>=2.0.0rc1, <2.0.0.

Screenshot 2023-04-05 at 7 24 15 PM

Reproduces the problem - code sample

import os
import torch

if torch.cuda.is_available():
    os.environ['CUBLAS_WORKSPACE_CONFIG'] = ':16:8'
    
from mmengine.config import Config, DictAction
from mmengine.runner import Runner

from mmselfsup.utils import register_all_modules

# register all modules in mmselfsup into the registries
# do not init the default scope here because it will be init in the runner
register_all_modules(init_default_scope=False)

# build the runner from config
runner = Runner.from_cfg(cfg)

# start training
runner.train()

Reproduces the problem - command or script

No response

Reproduces the problem - error message

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
/tmp/ipykernel_5426/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.

Additional information

  1. Are we supporting pytorch 1.10 with 1.x branch
  2. how to resolve the issue of mmcv version conflicts

Have attached the demo notebook with all the respective logs
mmselfsup_colab_tutorial.ipynb.zip

@letdivedeep letdivedeep added the Bug Something isn't working label Apr 5, 2023
@fangyixiao18
Copy link
Collaborator

I guess the problem is the version of your mmdet, please update your mmdet to 3.0.0rc6 to match the version

@letdivedeep
Copy link
Author

@fangyixiao18 Thanks for your input ... it helped me solve the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants