win10 conda py3.7下编译rcnn的cython报错'MSVCCompiler' object has no attribute 'compiler_so'
原因是wiin python环境下的没有compiler_so(linux才有)
解决方法是注释掉有关‘self.compiler_so’的行:
#default_compiler_so = self.compiler_so
#self.compiler_so = default_compiler_so
------------------------------如果运气好,到此结束-------------------------------
若提示xxx error C2039: “exc_type”: 不是“_ts”的成员
bbox.c(xxx): error C2039: “exc_type”: 不是“_ts”的成员
bbox.c(xxx): error C2039: “exc_value”: 不是“_ts”的成员
bbox.c(xxx): error C2039: “exc_traceback”: 不是“_ts”的成员
anchors.c(xxx): error C2039: “exc_type”: 不是“_ts”的成员
anchors.c(xxx): error C2039: “exc_value”: 不是“_ts”的成员
anchors.c(xxx): error C2039: “exc_traceback”: 不是“_ts”的成员
cpu_nms.c(xxx): error C2039: “exc_type”: 不是“_ts”的成员
cpu_nms.c(xxx): error C2039: “exc_value”: 不是“_ts”的成员
cpu_nms.c(xxx): error C2039: “exc_traceback”: 不是“_ts”的成员
原因是你的python版本不匹配,看头文pystate.h件可知:
exc_type, exc_value, exc_traceback这三个成员是在结构体_PyErr_StackItem中(exc_state对象)
所以,解决方法是所有c文件报错的地方
tstate->xxxx;
都要改成
tstate->exc_state.xxxx;
/*
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
tstate->exc_type = local_type;
tstate->exc_value = local_value;
tstate->exc_traceback = local_tb;
*/
tmp_type = tstate->exc_state.exc_type;
tmp_value = tstate->exc_state.exc_value;
tmp_tb = tstate->exc_state.exc_traceback;
tstate->exc_state.exc_type = local_type;
tstate->exc_state.exc_value = local_value;
tstate->exc_state.exc_traceback = local_tb;
编译通过,哈哈
附上RetinaFaceAntiCov test.py运行结果: