lichengunc / refer

Referring Expression Datasets API
Apache License 2.0
451 stars 79 forks source link

Cython fail to compile #8

Open jsuit opened 4 years ago

jsuit commented 4 years ago

Error: Error compiling Cython file: ------------------------------------------------------------ ... cdef np.ndarray[np.double_t, ndim=1] np_poly n = len(poly) Rs = RLEs(n) for i, p in enumerate(poly): np_poly = np.array(p, dtype=np.double, order='F') rleFrPoly( <RLE*>&Rs._R[i], <const double*> np_poly.data, len(np_poly)/2, h, w ) ^ ------------------------------------------------------------ external/_mask.pyx:258:78: Cannot assign type 'double' to 'siz' Traceback (most recent call last): File "setup.py", line 24, in <module> ext_modules=cythonize(ext_modules) File "/opt/miniconda3/envs/pytorch1.6/lib/python3.6/site-packages/Cython-3.0a6-py3.6-linux-x86_64.egg/Cython/Build/Dependencies.py", line 1110, in cythonize cythonize_one(*args) File "/opt/miniconda3/envs/pytorch1.6/lib/python3.6/site-packages/Cython-3.0a6-py3.6-linux-x86_64.egg/Cython/Build/Dependencies.py", line 1277, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: external/_mask.pyx

python version =3.6, cython = 3.0a6

DwanZhang-AI commented 1 year ago

Same

sarvghotra commented 11 months ago

The solution given here worked for me.

lucasea777 commented 1 month ago

Based on the link @sarvghotra shared: In setup.py, replace

ext_modules=cythonize(ext_modules)

with

ext_modules=cythonize(ext_modules, language_level = "2")