MacOS 编译 PyTorch 的 Cpp 项目

Compile

MacOS 运行 CornerNet-Lite 项目。


cpools

编译cpools库:

cd <CornerNet-Lite dir>/core/models/py_utils/_cpools/
python setup.py install --user

Bug:

torch/lib/include/c10/Device.h:109:8: error:
      redefinition of 'hash'

torch/lib/include/c10/util/UniqueVoidPtr.h:108:54: error:
      no type named 'nullptr_t' in namespace 'std'

明显是Cpp异常,解决方案,参考

export MACOSX_DEPLOYMENT_TARGET=10.11

即可。


nms

编译nms文件:

cd <CornerNet-Lite dir>/core/external
make

Bug:

bbox.pyx:1:0: 'CornerNet-Lite.core.external.bbox' is not a valid module name

明显是模块异常,解决方案,参考

according to this, I delete __ init__.py then it's installed successfully.

即删除 __ init__.py 文件。


OK,that's all!