window10 pytorch编译DCNv2 遇到的错误
错误1:
UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
解决方案:
pip install ninja
错误2:
error: identifier "THCState_getCurrentStream" is undefined
解决方案
1.下载最新的DCNv2 地址:https://github.com/jinfagang/DCNv2_latest
2.替换原来的DCNv2文件
3.环境使用目前支持的pytorch ≤ 1.8 (开始使用的pytorch 版本=1.10)
编译成功
copying build\lib.win-amd64-3.7\_ext.cp37-win_amd64.pyd ->
Creating j:\worksoft\envs\yolact\lib\site-packages\DCNv2.egg-link (link to .)
Adding DCNv2 0.1 to easy-install.pth file
在Windows10系统中使用PyTorch编译DCNv2时遇到了两个错误。错误1是缺少ninja构建工具,通过运行`pip install ninja`解决了问题。错误2是关于THCState_getCurrentStream标识符未定义,通过更新到最新版DCNv2代码并降低PyTorch版本至1.8解决了该问题。最终成功编译并安装了DCNv2库。
1997





