cython_bbox.so: undefined symbol: _Py_ZeroStruct
Asked Answered
W

3

6

I try to do all these steps because I want a different version python 3.5 on linux to run the code in this example https://learn.microsoft.com/en-us/cognitive-toolkit/Object-Detection-using-Fast-R-CNN

If you need a different version you can compile it following these steps:

git clone --recursive https://github.com/rbgirshick/fast-rcnn.git
cd $FRCN_ROOT/lib
make
python setup.py build_ext --inplace.
copy the generated cython_bbox and cython_nms binaries from 
$FRCN_ROOT/lib/utils to $CNTK_ROOT/Examples/Image/Detection/FastRCNN/fastRCNN/utils
**Error**
Traceback (most recent call last):
  File "C1_DrawBboxesOnImages.py", line 10, in <module>
    from cntk_helpers import *
  File "/home/tftuts/Desktop/tensorflow/CNTK-master/Examples/Image/Detection/FastRCNN/cntk_helpers.py", line 13, in <module>
    from fastRCNN.nms import nms as nmsPython
  File "/home/tftuts/Desktop/tensorflow/CNTK-master/Examples/Image/Detection/FastRCNN/fastRCNN/__init__.py", line 7, in <module>
    from .imdb import imdb
  File "/home/tftuts/Desktop/tensorflow/CNTK-master/Examples/Image/Detection/FastRCNN/fastRCNN/imdb.py", line 16, in <module>
    from .utils.cython_bbox import bbox_overlaps
ImportError: /home/tftuts/Desktop/tensorflow/CNTK-master/Examples/Image/Detection/FastRCNN/fastRCNN/utils/cython_bbox.so: undefined symbol: _Py_ZeroStruct

please any one can help me. what means

cython_bbox.so: undefined symbol: _Py_ZeroStruct 

and how resolve this problem.

Weakness answered 24/6, 2017 at 13:47 Comment(0)
B
11

This error message is typical when there's a version mismatch in Python modules. It could something like cython_bbox.so was compiled and linked against Python 2.7 and CNTK was compiled against Python 3.5. It's hard to say exactly what the reason is but you can try to do make inside a python environment that matches your CNTK version and see if that works.

Benefaction answered 22/8, 2017 at 21:9 Comment(1)
Thank you! Turns out my /usr/bin/python symbolic link was pointing to /usr/bin/python2 instead of /usr/bin/python3. Changing it to point to /usr/bin/python3 resolved the issue for me.Willingham
R
0

try compile it with python3.

The default python version in Linux maybe 2.x

Rodger answered 6/6, 2019 at 11:34 Comment(0)
M
0

It is because of the python version mismatch. As default, it is compiled with python 2.7.

Edit the make.sh file to compile with python3 and compile once again.

For instance,

change python setup.py to python3 setup.py

This solved the issue for me.

Micelle answered 9/7, 2020 at 13:43 Comment(1)
where is the file please make.shHest

© 2022 - 2024 — McMap. All rights reserved.