facebookresearch / facebookresearch/detectron2
Detectron2 issue on Mac intel
- Dominant language
- Python
- Stars
- 34.7k
- Forks
- 7.9k
- PR merge metrics
- No merged PRs in 30d
Description
## Instructions To Reproduce the 🐛 Bug:
1. Full runnable code or full changes made:
```
# I want to have detectron2 to be able to use layoutparser.
# On the webpage (https://layout-parser.github.io/tutorials/installation) it says to run
pip3 install 'git+https://github.com/facebookresearch/detectron2.git@v0.4#egg=detectron2'
# if not working then it directs to a page (https://github.com/facebookresearch/detectron2/blob/main/INSTALL.md)
# which explains the requirements. It did not work for me with the first method. The requirements I looked at and
# followed the steps:
# 1) Linux or macOS with Python ≥ 3.7
# 2) PyTorch ≥ 1.8 and [torchvision](https://github.com/pytorch/vision/) that matches the PyTorch installation.
# Install them together at [pytorch.org](https://pytorch.org/) to make sure of this
# 3) OpenCV is optional but needed by demo and visualization
# To get these I run:
python --version
# output: Python 3.11.5
pip install torch torchvision torchaudio
pip install opencv-python
# Then, to build Detectron2 from Source gcc & g++ ≥ 5.4 are required, so I run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install gcc
xcode-select --install
# Then, as I understood now I can build detectron2, I tried to run with all these three methods:
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
# (add --user if you don't have permission)
# Or, to install it from a local clone:
git clone https://github.com/facebookresearch/detectron2.git
python -m pip install -e detectron2
# On macOS, you may need to prepend the above commands with a few environment variables:
CC=clang CXX=clang++ ARCHFLAGS="-arch x86_64" python -m pip install ...
# But none worked.
# My error message:
# fatal error: too many errors emitted, stopping now [-ferror-limit=]
# 20 errors generated.
# error: command '/usr/bin/clang' failed with exit code 1
# [end of output]
# note: This error originates from a subprocess, and is likely not a problem with pip.
# ERROR: Failed building wheel for detectron2
# Running setup.py clean for detectron2
# Failed to build detectron2
# ERROR: Could not build wheels for detectron2, which is required to install pyproject.toml-based projects
```
Contributor guide
Research direction
Start with INSTALL.md and reproduce the listed pip and build commands on an Intel Mac using the reported Python 3.11.5, PyTorch, torchvision, and clang setup. Inspect the complete compiler errors preceding the truncated output; done means the installation succeeds or the failure is narrowed to a specific supported-version or build issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, macos, opencv, python, pytorch
- Domain
- build-system, computer-vision, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100