Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Conversation

@anujonthemove
Copy link
Contributor

This script was throwing error while installing cocoapi, the changes I made above solved this for my setup.

This script was throwing error while installing cocoapi, the changes I made above solved this for my setup.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@anujonthemove
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@pooyadavoodi
Copy link

Thanks @anujonthemove

Could you please share the error msg you were getting?

@anujonthemove
Copy link
Contributor Author

anujonthemove commented Jan 27, 2019

Thanks @anujonthemove

Could you please share the error msg you were getting?

When I ran the original script, it throws the following error as it begins installing cocoapi:

echo Install cocodataset/cocoapi/PythonAPI...
Install cocodataset/cocoapi/PythonAPI...
pushd $PYCOCO_DIR
~/git/others/tensorrt/tftrt/examples/third_party/cocoapi/PythonAPI ~/git/others/tensorrt/tftrt/examples/object_detection
pip install .
Processing /home/anuj/git/others/tensorrt/tftrt/examples/third_party/cocoapi/PythonAPI
Requirement already satisfied: setuptools>=18.0 in /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages (from pycocotools==2.0) (40.6.3)
Requirement already satisfied: cython>=0.27.3 in /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages (from pycocotools==2.0) (0.29.3)
Requirement already satisfied: matplotlib>=2.1.0 in /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages (from pycocotools==2.0) (3.0.2)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages (from matplotlib>=2.1.0->pycocotools==2.0) (2.3.1)
Requirement already satisfied: python-dateutil>=2.1 in /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages (from matplotlib>=2.1.0->pycocotools==2.0) (2.7.5)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages (from matplotlib>=2.1.0->pycocotools==2.0) (1.0.1)
Requirement already satisfied: cycler>=0.10 in /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages (from matplotlib>=2.1.0->pycocotools==2.0) (0.10.0)
Requirement already satisfied: numpy>=1.10.0 in /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages (from matplotlib>=2.1.0->pycocotools==2.0) (1.16.0)
Requirement already satisfied: six>=1.5 in /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages (from python-dateutil>=2.1->matplotlib>=2.1.0->pycocotools==2.0) (1.12.0)
Building wheels for collected packages: pycocotools
  Building wheel for pycocotools (setup.py) ... error
  Complete output from command /home/anuj/.virtualenvs/analytics-3/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-f5im0z56/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-p97z6vqj --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  running build_ext
  skipping 'pycocotools/_mask.c' Cython extension (up-to-date)
  building 'pycocotools._mask' extension
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages/numpy/core/include -I../common -I/usr/include/python3.5m -I/home/anuj/.virtualenvs/analytics-3/include/python3.5m -c ../common/maskApi.c -o build/temp.linux-x86_64-3.5/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
  x86_64-linux-gnu-gcc: error: ../common/maskApi.c: No such file or directory
  x86_64-linux-gnu-gcc: fatal error: no input files
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for pycocotools
  Running setup.py clean for pycocotools
Failed to build pycocotools
Installing collected packages: pycocotools
  Found existing installation: pycocotools 2.0
    Uninstalling pycocotools-2.0:
      Successfully uninstalled pycocotools-2.0
  Running setup.py install for pycocotools ... error
    Complete output from command /home/anuj/.virtualenvs/analytics-3/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-f5im0z56/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-m9fk01d3/install-record.txt --single-version-externally-managed --compile --install-headers /home/anuj/.virtualenvs/analytics-3/include/site/python3.5/pycocotools:
    running install
    running build
    running build_py
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/pycocotools
    copying pycocotools/mask.py -> build/lib.linux-x86_64-3.5/pycocotools
    copying pycocotools/cocoeval.py -> build/lib.linux-x86_64-3.5/pycocotools
    copying pycocotools/coco.py -> build/lib.linux-x86_64-3.5/pycocotools
    copying pycocotools/__init__.py -> build/lib.linux-x86_64-3.5/pycocotools
    running build_ext
    skipping 'pycocotools/_mask.c' Cython extension (up-to-date)
    building 'pycocotools._mask' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/pycocotools
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages/numpy/core/include -I../common -I/usr/include/python3.5m -I/home/anuj/.virtualenvs/analytics-3/include/python3.5m -c ../common/maskApi.c -o build/temp.linux-x86_64-3.5/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
    x86_64-linux-gnu-gcc: error: ../common/maskApi.c: No such file or directory
    x86_64-linux-gnu-gcc: fatal error: no input files
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of pycocotools
Command "/home/anuj/.virtualenvs/analytics-3/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-f5im0z56/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-m9fk01d3/install-record.txt --single-version-externally-managed --compile --install-headers /home/anuj/.virtualenvs/analytics-3/include/site/python3.5/pycocotools" failed with error code 1 in /tmp/pip-req-build-f5im0z56/
popd
~/git/others/tensorrt/tftrt/examples/object_detection

I searched around for this particular error: "x86_64-linux-gnu-gcc: error: ../common/maskApi.c: No such file or directory" (CAN BE FOUND IN THE ABOVE TRACE), tried to manually install cocoapi alone and found a solution suggested in the following github issues: cocodataset/cocoapi#170 (and many others), used the same solution in the 'install_dependencies.sh' script and it worked.

Reasons for building with 'inplace' flag: I wanted to install cocoapi in a particular virtual environment.

TRACE AFTER FIXING THE 'install_dependencies.sh' script:

popd
~/git/others/tensorrt/tftrt/examples/object_detection

echo Install cocodataset/cocoapi/PythonAPI...
Install cocodataset/cocoapi/PythonAPI...
pushd $PYCOCO_DIR
~/git/others/tensorrt/tftrt/examples/third_party/cocoapi/PythonAPI ~/git/others/tensorrt/tftrt/examples/object_detection
python setup.py build_ext --inplace
running build_ext
skipping 'pycocotools/_mask.c' Cython extension (up-to-date)
copying build/lib.linux-x86_64-3.5/pycocotools/_mask.cpython-35m-x86_64-linux-gnu.so -> pycocotools
make
python setup.py build_ext --inplace
running build_ext
skipping 'pycocotools/_mask.c' Cython extension (up-to-date)
copying build/lib.linux-x86_64-3.5/pycocotools/_mask.cpython-35m-x86_64-linux-gnu.so -> pycocotools
rm -rf build
# pip install .
python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to pycocotools.egg-info/requires.txt
writing dependency_links to pycocotools.egg-info/dependency_links.txt
writing pycocotools.egg-info/PKG-INFO
writing top-level names to pycocotools.egg-info/top_level.txt
reading manifest file 'pycocotools.egg-info/SOURCES.txt'
writing manifest file 'pycocotools.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/pycocotools
copying pycocotools/mask.py -> build/lib.linux-x86_64-3.5/pycocotools
copying pycocotools/cocoeval.py -> build/lib.linux-x86_64-3.5/pycocotools
copying pycocotools/coco.py -> build/lib.linux-x86_64-3.5/pycocotools
copying pycocotools/__init__.py -> build/lib.linux-x86_64-3.5/pycocotools
running build_ext
skipping 'pycocotools/_mask.c' Cython extension (up-to-date)
building 'pycocotools._mask' extension
creating build/common
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/pycocotools
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages/numpy/core/include -I../common -I/usr/include/python3.5m -I/home/anuj/.virtualenvs/analytics-3/include/python3.5m -c ../common/maskApi.c -o build/temp.linux-x86_64-3.5/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
../common/maskApi.c: In function ‘rleToBbox’:
../common/maskApi.c:141:31: warning: ‘xp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       if(j%2==0) xp=x; else if(xp<x) { ys=0; ye=h-1; }
                               ^
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages/numpy/core/include -I../common -I/usr/include/python3.5m -I/home/anuj/.virtualenvs/analytics-3/include/python3.5m -c pycocotools/_mask.c -o build/temp.linux-x86_64-3.5/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/../common/maskApi.o build/temp.linux-x86_64-3.5/pycocotools/_mask.o -o build/lib.linux-x86_64-3.5/pycocotools/_mask.cpython-35m-x86_64-linux-gnu.so
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/pycocotools
copying build/lib.linux-x86_64-3.5/pycocotools/_mask.cpython-35m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/pycocotools
copying build/lib.linux-x86_64-3.5/pycocotools/mask.py -> build/bdist.linux-x86_64/egg/pycocotools
copying build/lib.linux-x86_64-3.5/pycocotools/cocoeval.py -> build/bdist.linux-x86_64/egg/pycocotools
copying build/lib.linux-x86_64-3.5/pycocotools/coco.py -> build/bdist.linux-x86_64/egg/pycocotools
copying build/lib.linux-x86_64-3.5/pycocotools/__init__.py -> build/bdist.linux-x86_64/egg/pycocotools
byte-compiling build/bdist.linux-x86_64/egg/pycocotools/mask.py to mask.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/pycocotools/cocoeval.py to cocoeval.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/pycocotools/coco.py to coco.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/pycocotools/__init__.py to __init__.cpython-35.pyc
creating stub loader for pycocotools/_mask.cpython-35m-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/pycocotools/_mask.py to _mask.cpython-35.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying pycocotools.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pycocotools.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pycocotools.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pycocotools.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pycocotools.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
pycocotools.__pycache__._mask.cpython-35: module references __file__
creating 'dist/pycocotools-2.0-py3.5-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pycocotools-2.0-py3.5-linux-x86_64.egg
removing '/home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages/pycocotools-2.0-py3.5-linux-x86_64.egg' (and everything under it)
creating /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages/pycocotools-2.0-py3.5-linux-x86_64.egg
Extracting pycocotools-2.0-py3.5-linux-x86_64.egg to /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages
Adding pycocotools 2.0 to easy-install.pth file

Installed /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages/pycocotools-2.0-py3.5-linux-x86_64.egg
Processing dependencies for pycocotools==2.0
Searching for matplotlib==3.0.2
Best match: matplotlib 3.0.2
Adding matplotlib 3.0.2 to easy-install.pth file

Using /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages
Searching for Cython==0.29.3
Best match: Cython 0.29.3
Adding Cython 0.29.3 to easy-install.pth file
Installing cython script to /home/anuj/.virtualenvs/analytics-3/bin
Installing cythonize script to /home/anuj/.virtualenvs/analytics-3/bin
Installing cygdb script to /home/anuj/.virtualenvs/analytics-3/bin

Using /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages
Searching for setuptools==40.6.3
Best match: setuptools 40.6.3
Adding setuptools 40.6.3 to easy-install.pth file
Installing easy_install-3.6 script to /home/anuj/.virtualenvs/analytics-3/bin
Installing easy_install script to /home/anuj/.virtualenvs/analytics-3/bin

Using /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages
Searching for kiwisolver==1.0.1
Best match: kiwisolver 1.0.1
Adding kiwisolver 1.0.1 to easy-install.pth file

Using /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages
Searching for pyparsing==2.3.1
Best match: pyparsing 2.3.1
Adding pyparsing 2.3.1 to easy-install.pth file

Using /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages
Searching for python-dateutil==2.7.5
Best match: python-dateutil 2.7.5
Adding python-dateutil 2.7.5 to easy-install.pth file

Using /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages
Searching for cycler==0.10.0
Best match: cycler 0.10.0
Adding cycler 0.10.0 to easy-install.pth file

Using /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages
Searching for numpy==1.16.0
Best match: numpy 1.16.0
Adding numpy 1.16.0 to easy-install.pth file
Installing f2py script to /home/anuj/.virtualenvs/analytics-3/bin
Installing f2py3.5 script to /home/anuj/.virtualenvs/analytics-3/bin
Installing f2py3 script to /home/anuj/.virtualenvs/analytics-3/bin

Using /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages
Searching for six==1.12.0
Best match: six 1.12.0
Adding six 1.12.0 to easy-install.pth file

Using /home/anuj/.virtualenvs/analytics-3/lib/python3.5/site-packages
Finished processing dependencies for pycocotools==2.0
popd
~/git/others/tensorrt/tftrt/examples/object_detection


@pooyadavoodi
Copy link

Thanks @anujonthemove for the PR.

@pooyadavoodi pooyadavoodi merged commit 34344a9 into tensorflow:master Feb 1, 2019
DEKHTIARJonathan pushed a commit that referenced this pull request Nov 19, 2021
This script was throwing error while installing cocoapi, the changes I made above solved this for my setup.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants