mmpose
mmpose copied to clipboard
Unable to import MMPoseInferencer in Colab [Bug]
Prerequisite
- [X] I have searched Issues and Discussions but cannot get the expected help.
- [X] The bug has not been fixed in the latest version(https://github.com/open-mmlab/mmpose).
Environment
OrderedDict([('sys.platform', 'linux'), ('Python', '3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]'), ('CUDA available', True), ('MUSA available', False), ('numpy_random_seed', 2147483648), ('GPU 0', 'Tesla T4'), ('CUDA_HOME', '/usr/local/cuda'), ('NVCC', 'Cuda compilation tools, release 12.2, V12.2.140'), ('GCC', 'x86_64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0'), ('PyTorch', '2.2.1+cu121'), ('PyTorch compiling details', 'PyTorch built with:\n - GCC 9.3\n - C++ Version: 201703\n - Intel(R) oneAPI Math Kernel Library Version 2022.2-Product Build 20220804 for Intel(R) 64 architecture applications\n - Intel(R) MKL-DNN v3.3.2 (Git Hash 2dc95a2ad0841e29db8b22fbccaf3e5da7992b01)\n - OpenMP 201511 (a.k.a. OpenMP 4.5)\n - LAPACK is enabled (usually provided by MKL)\n - NNPACK is enabled\n - CPU capability usage: AVX512\n - CUDA Runtime 12.1\n - NVCC architecture flags: -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;-gencode;arch=compute_90,code=sm_90\n - CuDNN 8.9.2\n - Magma 2.6.1\n - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=12.1, CUDNN_VERSION=8.9.2, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-stringop-overflow -Wsuggest-override -Wno-psabi -Wno-error=pedantic -Wno-error=old-style-cast -Wno-missing-braces -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=2.2.1, 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=1, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF, \n'), ('TorchVision', '0.17.1+cu121'), ('OpenCV', '4.8.0'), ('MMEngine', '0.10.4'), ('MMPose', '1.3.1+5a3be94')])
Reproduces the problem - code sample
!pip3 install openmim !mim install mmengine !mim install "mmcv>=2.0.1"
!git clone https://github.com/open-mmlab/mmpose.git %cd mmpose !pip install -e .
%cd ..
!git clone https://github.com/open-mmlab/mmdetection.git
%cd mmdetection %pip install -v -e . -r requirements/tracking.txt
from mmpose.apis import MMPoseInferencer img_path = 'tests/data/coco/000000000785.jpg' inferencer = MMPoseInferencer('human') result_generator = inferencer(img_path, show=True) result = next(result_generator)
Reproduces the problem - command or script
from mmpose.apis import MMPoseInferencer
Reproduces the problem - error message
AssertionError Traceback (most recent call last)
4 frames
/content/mmpose/mmpose/apis/init.py in
/content/mmpose/mmpose/apis/inferencers/init.py in
/content/mmpose/mmpose/apis/inferencers/hand3d_inferencer.py in
/content/mmpose/mmpose/apis/inferencers/base_mmpose_inferencer.py in
/content/mmdetection/mmdet/init.py in
18 f'MMCV=={mmcv.version} is used but incompatible. '
19 f'Please install mmcv>={mmcv_minimum_version}, <{mmcv_maximum_version}.'
AssertionError: MMCV==2.2.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.2.0.
Additional information
I expected to see an image with pose estimation. I think there is a dependency conflict between mmdet-3.3.0 and mmcv 2.2.0. How do I fix this? I am unable to install mmdet using mim, so that is why I installed from the source in the script above.
Any updates?
Also working through the same error at the moment:
MMCV==2.2.0 is used but incompatible.
Using MMCV 2.1.0 seemed to fix the issue.
@Nachiket-ML Mine hangs at !mim install "mmcv==2.1.0" . How long did it take you to install 2.1.0?
Installing 2.2.0 was quick though but was incompatible as the error message above says.
[Edit: turns out it took 23 min for me]