Faster-rcnn.pytorch: Is gcc>=4.9 required to build for the Pytorch-1.0 branch?

Created on 17 Jan 2019  路  2Comments  路  Source: jwyang/faster-rcnn.pytorch

I am trying to run the pytorch-1.0 branch to train res101 model with Visual Genome.
I use python=2.7, cuda=9.1 with Tesla V100 cards

When I run python setup.py build develop, I received a warning:

Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch!
Please use a compiler that is ABI-compatible with GCC 4.9 and above.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.

When I run trainval_net.py, I encounter a "cannot import name _mask":

Traceback (most recent call last):
  File "trainval_net.py", line 27, in <module>
    from roi_data_layer.roidb import combined_roidb
  File "/home1/yul/yzq/faster-rcnn.pytorch-1.0/lib/roi_data_layer/roidb.py", line 9, in <module>
    from datasets.factory import get_imdb
  File "/home1/yul/yzq/faster-rcnn.pytorch-1.0/lib/datasets/factory.py", line 15, in <module>
    from datasets.coco import coco
  File "/home1/yul/yzq/faster-rcnn.pytorch-1.0/lib/datasets/coco.py", line 23, in <module>
    from pycocotools.coco import COCO
  File "/home1/yul/yzq/faster-rcnn.pytorch-1.0/lib/pycocotools/coco.py", line 60, in <module>
    from . import mask
  File "/home1/yul/yzq/faster-rcnn.pytorch-1.0/lib/pycocotools/mask.py", line 3, in <module>
    from . import _mask
ImportError: cannot import name _mask

Most helpful comment

Here I quote @JojoFisherman

Just find out that you have to install the CoCO API.

cd data
git clone https://github.com/pdollar/coco.git 
cd coco/PythonAPI
make

All 2 comments

I had the same problem and I solved it by just copying faster-rcnn.pytorch/lib/pycocotools/build/lib.linux-x86_64-2.7/_mask.so to faster-rcnn.pytorch/lib/pycocotools/_mask.so after following these instructions.

Here I quote @JojoFisherman

Just find out that you have to install the CoCO API.

cd data
git clone https://github.com/pdollar/coco.git 
cd coco/PythonAPI
make
Was this page helpful?
0 / 5 - 0 ratings

Related issues

GPaolo picture GPaolo  路  5Comments

Wanggcong picture Wanggcong  路  5Comments

MathewXiren picture MathewXiren  路  5Comments

Codermay picture Codermay  路  5Comments

manoja328 picture manoja328  路  3Comments