Skip to content

SOLVED: mmdet setup installation for macOS (and other platforms) #12404

@tam-trance

Description

@tam-trance

I'm sharing what worked for me on my Macbook M2 Max
I encountered a lot of the same problems that others had posted, was about to give up, and fortunately finally found something working for me. So here it is step by step 🙂

Goal: New user to openmmlab. Want to install mmdet / mmdetection.
DON'T: Follow instructions on mmdetection page. https://mmdetection.readthedocs.io/en/latest/get_started.html
DO: Follow the installation instructions per PACKAGE individually, in the following order: torch, mmengine, mmcv, then lastly mmdet

I'm not a big conda user, but for this I reluctantly accepted lol.
So:

Create the virtual env with python-3.8

conda create --name openmmlab python=3.8 -y
conda activate openmmlab

Install torch and compatible torchvision packages
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 -c pytorch
Find your necessary torch version here, according to your platform
https://mmcv.readthedocs.io/en/latest/get_started/installation.html
Image
Then find the appropriate torch package versions here
https://pytorch.org/get-started/previous-versions/
Image

I decide to skip installing their package manager openmim for simplicity's sake
and thus go with pip

pip install mmengine
pip install mmcv==2.0.0rc4 -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.13/index.html

Note: above command was retrieved from above picture

Now you're ready to install mmdet! I do the git version so that I can use pip

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -v -e .

Verify the installation

mim download mmdet --config rtmdet_tiny_8xb32-300e_coco --dest .
python demo/image_demo.py demo/demo.jpg rtmdet_tiny_8xb32-300e_coco.py --weights rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth --device cpu

And it worked for me! Trying the tracking installation next. Good luck!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions