Open jsuit opened 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
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
Same
The solution given here worked for me.
Based on the link @sarvghotra shared: In setup.py, replace
ext_modules=cythonize(ext_modules)
with
ext_modules=cythonize(ext_modules, language_level = "2")
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