MMCV Full (OpenMMLab Computer Vision Foundation)
raw JSON → 1.7.2 verified Mon Apr 27 auth: no python maintenance
OpenMMLab computer vision foundation library providing CUDA/C++ ops, data transforms, and utilities for deep learning. Current PyPI version is 1.7.2 (legacy mmcv-full). MMCV has been unified into a single `mmcv` package starting from v2.0.0; mmcv-full is no longer updated for v2.x. Release cadence: occasional.
pip install -U openmim && mim install mmcv-full Common errors
error ModuleNotFoundError: No module named 'mmcv._ext' ↓
cause Mismatch between compiled ops and installed PyTorch/CUDA version.
fix
Use
mim install mmcv-full to install a pre-built wheel matching your environment, or rebuild from source. error ImportError: cannot import name 'fuse_conv_bn' from 'mmcv' ↓
cause Function was removed in mmcv v2.0.0. mmcv-full v1.7.2 still has it.
fix
If using v1.x, ensure correct version. For v2.x, use
mmengine for fused BN. error RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1 ↓
cause Model saved with multi-GPU but loaded on single GPU.
fix
Load with
map_location='cuda:0' or set CUDA_VISIBLE_DEVICES appropriately. Warnings
breaking mmcv-full v1.x and mmcv v2.x are not API compatible. mmcv-full v1.x uses `from mmcv.runner` etc. mmcv v2.x moved training modules to mmengine. ↓
fix For new projects, use `mmcv` (v2.x) with `mmengine`. For existing code, stay on mmcv-full or upgrade with adaptation.
gotcha pip install mmcv-full may install a CPU-only build or fail due to missing CUDA support. Always verify the built wheel matches your torch version and CUDA. ↓
fix Use `pip install -U openmim && mim install mmcv-full` to auto-select correct wheel.
deprecated mmcv-full is deprecated for v2.x. New features and fixes are only on the unified `mmcv` package (v2.x). ↓
fix Migrate to `mmcv` (v2.x) + `mmengine` for new projects.
Install
pip install mmcv-full Imports
- mmcv wrong
from mmcv import *correctimport mmcv
Quickstart
import mmcv
import numpy as np
from PIL import Image
# Load an image from file
img = mmcv.imread('path/to/image.jpg')
print('Image shape:', img.shape)
# Apply a filter (example: Gaussian blur)
blurred = mmcv.gaussian_blur(img, kernel_size=5)
# Resize image
resized = mmcv.imresize(img, (224, 224))
# Visualize or save
mmcv.imwrite(resized, 'resized.jpg')