报错集锦:
1. File “nms.pyx”, line 25, in nms.nms
cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1]
ValueError: Buffer dtype mismatch, expected ‘int_t’ but got ‘long long’
参考实现代码:
https://github.com/eragonruan/text-detection-ctpn
需要修改文件nms.pyx:
cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1]
改成:
cdef np.ndarray[np.intp_t, ndim=1] order = scores.argsort()[::-1]
然后在box下运行:
python setup.py build_ext --inplace
2. fatal error C1083: Cannot open include file: ‘basetsd.h’: No such file or directory
https://stackoverflow.com/questions/23691564/running-cython-in-windows-x64-fatal-error-c1083-cannot-open-include-file-ba
下载sdk即可:
For those with Windows 10, download the SDK from here(https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/) to fix the header file basestd.h.
I downloaded the .exe, installed and worked great. SDK was ~2.3GB.
3. error: Unable to find vcvarsall.bat
下载vs
因为主要找不到这个文件:vcvarsall.bat
进入D:\Program Files (x86)\python\Python37-32\Lib\distutils\msvc9compiler.py
为什么下vs: 因为vs里有这个文件,把python相关的功能勾上!当然,直接去别人那拷估计也可以,我没试。