I am not sure. This problem is on my computer or the code.
After I run the code below,
python3 coco.py train --dataset=/media/coco --model=coco
Errors come up.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 16, in
from . import multiarray
ImportError: /usr/local/lib/python2.7/dist-packages/numpy/core/multiarray.so: undefined symbol: _Py_ZeroStruct
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "coco.py", line 32, in
import numpy as np
File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 142, in
from . import add_newdocs
File "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in
from numpy.lib import add_newdoc
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 8, in
from .type_check import *
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 11, in
import numpy.core.numeric as _nx
File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 26, in
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy. If you're working with a numpy git repo, try git clean -xdf (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: /usr/local/lib/python2.7/dist-packages/numpy/core/multiarray.so: undefined symbol: _Py_ZeroStruct
The error is an import error. And the message says "Most likely you are trying to import a failed build of numpy.". So I would guess it's not an error in the code.
Also, please note that this model is built and tested on Python 3.5. You might need to make a few changes to run it on 2.7.
can you solve this problem?
edit the Makefile located in coco/PythonAPI/:
original:
all:
# install pycocotools locally
python setup.py build_ext --inplace
rm -rf build
install:
# install pycocotools to the Python site-packages
python setup.py build_ext install
rm -rf build
modified:
all:
# install pycocotools locally
python setup.py build_ext --inplace
rm -rf buildi
python3 setup.py build_ext --inplace
install:
# install pycocotools to the Python site-packages
python setup.py build_ext install
rm -rf build
python3 setup.py build_ext install
rm -rf build
All in all, add python3.
edit the Makefile located in coco/PythonAPI/:
original:#
all:
install pycocotools locally
python setup.py build_ext --inplace
rm -rf buildinstall:
install pycocotools to the Python site-packages
python setup.py build_ext install
rm -rf build#
modified:
#
all:
install pycocotools locally
python setup.py build_ext --inplace
rm -rf buildi
python3 setup.py build_ext --inplaceinstall:
install pycocotools to the Python site-packages
python setup.py build_ext install
rm -rf build
python3 setup.py build_ext install
rm -rf build#
All in all, add python3.
thanks a lot
Most helpful comment
edit the Makefile located in coco/PythonAPI/:
original:
#
all:
# install pycocotools locally
python setup.py build_ext --inplace
rm -rf build
install:
# install pycocotools to the Python site-packages
python setup.py build_ext install
rm -rf build
#
modified:
#
all:
# install pycocotools locally
python setup.py build_ext --inplace
rm -rf buildi
python3 setup.py build_ext --inplace
install:
# install pycocotools to the Python site-packages
python setup.py build_ext install
rm -rf build
python3 setup.py build_ext install
rm -rf build
#
All in all, add python3.