Maskrcnn-benchmark: Install Instructions Incorrect in INSTALL.md

Created on 28 Feb 2019  路  2Comments  路  Source: facebookresearch/maskrcnn-benchmark

馃悰 Bug

The install instructions are incorrect and outdated. For one, pytorch nightly is no longer needed because pytorch 1.0 has been released. This simplifies the installation as one can use conda to install torchvision. Additionally, the order of operations doesn't make sense. The instructions presume the user has cloned the git repo by asking to install the requirements.txt and then later asks the user to clone the repo.

# first, make sure that your conda is setup properly with the right environment
# for that, check that `which conda`, `which pip` and `which python` points to the
# right path. From a clean conda env, this is what you need to do

conda create --name maskrcnn_benchmark
conda activate maskrcnn_benchmark

# this installs the right pip and dependencies for the fresh python
conda install ipython

# maskrcnn_benchmark and coco api dependencies
pip install -r requirements.txt

# follow PyTorch installation in https://pytorch.org/get-started/locally/
# we give the instructions for CUDA 9.0
conda install pytorch-nightly cudatoolkit=9.0 -c pytorch

export INSTALL_DIR=$PWD
# install torchvision
cd $INSTALL_DIR
git clone https://github.com/pytorch/vision.git
cd vision
python setup.py install

# install pycocotools
cd $INSTALL_DIR
git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
python setup.py build_ext install

# install PyTorch Detection
cd $INSTALL_DIR
git clone https://github.com/facebookresearch/maskrcnn-benchmark.git
cd maskrcnn-benchmark
# the following will install the lib with
# symbolic links, so that you can modify
# the files if you want and won't need to
# re-build it
python setup.py build develop

unset INSTALL_DIR

# or if you are on macOS
# MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py build develop

To Reproduce

See notes above. You can't install requirements.txt without cloning the repo.

Expected behavior

# first, make sure that your conda is setup properly with the right environment
# for that, check that `which conda`, `which pip` and `which python` points to the
# right path. From a clean conda env, this is what you need to do

conda create --name maskrcnn_benchmark
conda activate maskrcnn_benchmark

export INSTALL_DIR=$PWD

# this installs the right pip and dependencies for the fresh python
conda install ipython

# install pytorch
# "cudatoolkit=9.0" is optional.  If you have an different version of cuda, then try removing this parameter
conda install -c pytorch pytorch cudatoolkit=9.0 
conda install -c torchvision

# install PyTorch Detection
cd $INSTALL_DIR
git clone https://github.com/facebookresearch/maskrcnn-benchmark.git
cd maskrcnn-benchmark
pip install -r requirements.txt

# install pycocotools
cd $INSTALL_DIR
git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
python setup.py build_ext install

# install PyTorch Detection
cd $INSTALL_DIR
cd maskrcnn-benchmark
# the following will install the lib with
# symbolic links, so that you can modify
# the files if you want and won't need to
# re-build it
python setup.py build develop

unset INSTALL_DIR

# or if you are on macOS
# MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py build develop
bug

Most helpful comment

small suggestion. This line

conda install -c torchvision

should be changed to:

conda install -c pytorch torchvision

All 2 comments

Thanks for spotting the issue!

Indeed, the requirements.txt is a bug.
About PyTorch nightly, it's still good to have, but not a requirement anymore, and https://github.com/facebookresearch/maskrcnn-benchmark/pull/510 should address it.

cc @chengyangfu about https://github.com/facebookresearch/maskrcnn-benchmark/pull/502

small suggestion. This line

conda install -c torchvision

should be changed to:

conda install -c pytorch torchvision

Was this page helpful?
0 / 5 - 0 ratings