Skip to content

ppdet/ext_op python setup.py install 报错 #9340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 3 tasks
1431551850 opened this issue Mar 27, 2025 · 6 comments
Open
2 of 3 tasks

ppdet/ext_op python setup.py install 报错 #9340

1431551850 opened this issue Mar 27, 2025 · 6 comments
Assignees

Comments

@1431551850
Copy link

问题确认 Search before asking

  • 我已经查询历史issue,没有发现相似的bug。I have searched the issues and found no similar bug report.

Bug组件 Bug Component

No response

Bug描述 Describe the Bug

执行cd ppdet\ext_op
后执行python setup.py install报错
self.initialize_options()
[2025-03-27 18:46:19,861] [ INFO] dist.py:986 - running bdist_egg
[2025-03-27 18:46:19,921] [ INFO] dist.py:986 - running egg_info
[2025-03-27 18:46:19,940] [ INFO] egg_info.py:657 - writing ext_op.egg-info\PKG-INFO
[2025-03-27 18:46:19,941] [ INFO] egg_info.py:281 - writing dependency_links to ext_op.egg-info\dependency_links.txt
[2025-03-27 18:46:19,941] [ INFO] egg_info.py:281 - writing top-level names to ext_op.egg-info\top_level.txt
[2025-03-27 18:46:19,962] [ INFO] sdist.py:190 - reading manifest file 'ext_op.egg-info\SOURCES.txt'
[2025-03-27 18:46:19,965] [ INFO] util.py:329 - writing manifest file 'ext_op.egg-info\SOURCES.txt'
[2025-03-27 18:46:19,965] [ INFO] bdist_egg.py:161 - installing library code to build\ext_op\bdist.win-amd64\egg
[2025-03-27 18:46:19,965] [ INFO] dist.py:986 - running install_lib
[2025-03-27 18:46:19,965] [ INFO] dist.py:986 - running build_ext
2025-03-27 18:46:19,975 - INFO - Re-Compiling ext_op.pyd, because specified cflags have been changed. New signature 0e1fa606b390f34a525f77123e03e577 has been saved into D:\pythonproject\PaddleDetection\ppdet\ext_op\build\ext_op\lib.
win-amd64-cpython-310\version.txt.
[2025-03-27 18:46:19,975] [ INFO] extension_utils.py:1488 - Re-Compiling ext_op.pyd, because specified cflags have been changed. New signature 0e1fa606b390f34a525f77123e03e577 has been saved into D:\pythonproject\PaddleDetection
ppdet\ext_op\build\ext_op\lib.win-amd64-cpython-310\version.txt.
Compiling user custom op, it will cost a few seconds.....
[2025-03-27 18:46:20,110] [ INFO] build_ext.py:533 - building 'ext_op' extension
[2025-03-27 18:46:21,312] [ INFO] spawn.py:61 - "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W0 /GL /DNDEBUG /MT -ID:\anaconda3\envs\drugcheck\l
matched_rbox_iou.cc
[2025-03-27 18:46:23,348] [ INFO] spawn.py:61 - "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc" -c D:\pythonproject\PaddleDetection\ppdet\ext_op\csrc\matched_rbox_iou\matched_rbox_iou.cu -o D:\pythonproject\Pa
ddleDetection\ppdet\ext_op\build\ext_op\lib.win-amd64-cpython-310\matched_rbox_iou.cu.obj -ID:\anaconda3\envs\drugcheck\lib\site-packages\paddle\include -ID:\anaconda3\envs\drugcheck\lib\site-packages\paddle\include\third_party "-IC
:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -ID:\anaconda3\envs\drugcheck\Include -ID:\anaconda3\envs\drugcheck\include -ID:\anaconda3\envs\drugcheck\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\202
2\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxilia
ry\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:
Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -Xcompiler /DPADDLE_USE_DSO -Xcompiler /DNDEBUG -Xcompiler /DBOOST_HAS_STATIC_ASSERT -Xcomp
iler /DGOOGLE_GLOG_DLL_DECL -Xcompiler /w -Xcompiler /EHsc -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MT -DPADDLE_WITH_CUDA -DEIGE
N_USE_GPU -w -DPADDLE_WITH_CUSTOM_KERNEL --use-local-env
matched_rbox_iou.cu
[2025-03-27 18:46:32,668] [ INFO] spawn.py:61 - "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W0 /GL /DNDEBUG /MT -ID:\anaconda3\envs\drugcheck\l
ib\site-packages\paddle\include -ID:\anaconda3\envs\drugcheck\lib\site-packages\paddle\include\third_party "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -ID:\anaconda3\envs\drugcheck\Include -ID:\anaconda3\env
s\drugcheck\include -ID:\anaconda3\envs\drugcheck\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tool
s\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kit
s\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0
.22000.0\cppwinrt" /EHsc /TpD:\pythonproject\PaddleDetection\ppdet\ext_op\csrc\nms_rotated\nms_rotated.cc /FoD:\pythonproject\PaddleDetection\ppdet\ext_op\build\ext_op\lib.win-amd64-cpython-310\nms_rotated.obj /MT /wd4819 /wd4251 /
wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc /w /DGOOGLE_GLOG_DLL_DECL /DBOOST_HAS_STATIC_ASSERT /DNDEBUG /DPADDLE_USE_DSO -DPADDLE_WITH_CUDA -DPADDLE_WITH_CUSTOM_KERNEL -DPADDLE_WITH_CUDA
nms_rotated.cc
[2025-03-27 18:46:34,756] [ INFO] spawn.py:61 - "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc" -c D:\pythonproject\PaddleDetection\ppdet\ext_op\csrc\nms_rotated\nms_rotated.cu -o D:\pythonproject\PaddleDetect
ion\ppdet\ext_op\build\ext_op\lib.win-amd64-cpython-310\nms_rotated.cu.obj -ID:\anaconda3\envs\drugcheck\lib\site-packages\paddle\include -ID:\anaconda3\envs\drugcheck\lib\site-packages\paddle\include\third_party "-IC:\Program Files
\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -ID:\anaconda3\envs\drugcheck\Include -ID:\anaconda3\envs\drugcheck\include -ID:\anaconda3\envs\drugcheck\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC
\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include"
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (
x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -Xcompiler /DPADDLE_USE_DSO -Xcompiler /DNDEBUG -Xcompiler /DBOOST_HAS_STATIC_ASSERT -Xcompiler /DGOOGLE_G
LOG_DLL_DECL -Xcompiler /w -Xcompiler /EHsc -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MT -DPADDLE_WITH_CUDA -DEIGEN_USE_GPU -w -D
PADDLE_WITH_CUSTOM_KERNEL --use-local-env
nms_rotated.cu
[2025-03-27 18:46:44,164] [ INFO] spawn.py:61 - "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W0 /GL /DNDEBUG /MT -ID:\anaconda3\envs\drugcheck\l
ib\site-packages\paddle\include -ID:\anaconda3\envs\drugcheck\lib\site-packages\paddle\include\third_party "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -ID:\anaconda3\envs\drugcheck\Include -ID:\anaconda3\env
正在创建库 build\ext_op\lib.win-amd64-cpython-310\ext_op.lib 和对象 build\ext_op\lib.win-amd64-cpython-310\ext_op.exp
matched_rbox_iou.obj : error LNK2001: 无法解析的外部符号 "public: unsigned int __cdecl phi::Place::Hash::operator()(class phi::Place const &)const " (??RHash@Place@phi@@QEBAIAEBV12@@z)
matched_rbox_iou.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl phi::Place::Place(enum phi::AllocationType,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (??0Place@phi@@qe
AA@W4AllocationType@1@AEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z)
nms_rotated.cu.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl phi::Place::Place(enum phi::AllocationType,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (??0Place@phi@@qeaa
@W4AllocationType@1@AEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z)
matched_rbox_iou.cu.obj : error LNK2001: 无法解析的外部符号 "public: static class phi::CustomRegisteredDeviceMap & __cdecl phi::CustomRegisteredDeviceMap::Instance(void)" (?Instance@CustomRegisteredDeviceMap@phi@@SAAEAV12@XZ)
nms_rotated.cu.obj : error LNK2001: 无法解析的外部符号 "public: static class phi::CustomRegisteredDeviceMap & __cdecl phi::CustomRegisteredDeviceMap::Instance(void)" (?Instance@CustomRegisteredDeviceMap@phi@@SAAEAV12@XZ)
rbox_iou.cu.obj : error LNK2001: 无法解析的外部符号 "public: static class phi::CustomRegisteredDeviceMap & __cdecl phi::CustomRegisteredDeviceMap::Instance(void)" (?Instance@CustomRegisteredDeviceMap@phi@@SAAEAV12@XZ)
matched_rbox_iou.cu.obj : error LNK2001: 无法解析的外部符号 "public: unsigned __int64 __cdecl phi::CustomRegisteredDeviceMap::GetOrRegisterGlobalDeviceTypeId(class std::basic_string<char,struct std::char_traits,class std::allo
cator > const &)" (?GetOrRegisterGlobalDeviceTypeId@CustomRegisteredDeviceMap@phi@@QEAA_KAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z)
nms_rotated.cu.obj : error LNK2001: 无法解析的外部符号 "public: unsigned __int64 __cdecl phi::CustomRegisteredDeviceMap::GetOrRegisterGlobalDeviceTypeId(class std::basic_string<char,struct std::char_traits,class std::allocator
> const &)" (?GetOrRegisterGlobalDeviceTypeId@CustomRegisteredDeviceMap@phi@@QEAA_KAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z)
rbox_iou.cu.obj : error LNK2001: 无法解析的外部符号 "public: unsigned __int64 __cdecl phi::CustomRegisteredDeviceMap::GetOrRegisterGlobalDeviceTypeId(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?GetOrRegisterGlobalDeviceTypeId@CustomRegisteredDeviceMap@phi@@QEAA_KAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z)
build\ext_op\lib.win-amd64-cpython-310\ext_op.pyd : fatal error LNK1120: 4 个无法解析的外部命令
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\link.exe' failed with exit code 1120
Image
使用paddlepaddle-gpu2.5.0没问题但是会报错:
from paddle.base.framework import in_dygraph_mode
ModuleNotFoundError: No module named 'paddle.base.framework'

复现环境 Environment

paddle-bfloat 0.1.7
paddledet 0.0.0
paddlepaddle-gpu 2.6.0
PaddleDetection 是release/2.8.1
python 3.10.6
cuda 11.8

Bug描述确认 Bug description confirmation

  • 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • 我愿意提交PR!I'd like to help by submitting a PR!
@yocent
Copy link

yocent commented Apr 6, 2025

Image

@yocent
Copy link

yocent commented Apr 6, 2025

报一样的错 请问解决了吗?
环境:python 3.10.0 vs 2019 paddlepaddle 3.00

@1431551850
Copy link
Author

报一样的错 请问解决了吗? 环境:python 3.10.0 vs 2019 paddlepaddle 3.00

降级,PaddleDetection改成2.6,重新下载依赖

@yocent
Copy link

yocent commented Apr 8, 2025

正在创建库 build\ext_op\lib.win-amd64-3.10\ext_op.lib 和对象 build\ext_op\lib.win-amd64-3.10\ext_op.exp
matched_rbox_iou.obj : error LNK2001: 无法解析的外部符号 "public: unsigned int __cdecl phi::Place::Hash::operator()(class phi::Place const &)const " (??RHash@Place@phi@@QEBAIAEBV12@@z)
matched_rbox_iou.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl phi::Place::Place(enum phi::AllocationType,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (??0Place@phi@@qeaa@W4AllocationType@1@AEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z)
nms_rotated.cu.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl phi::Place::Place(enum phi::AllocationType,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (??0Place@phi@@qeaa@W4AllocationType@1@AEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z)
matched_rbox_iou.cu.obj : error LNK2001: 无法解析的外部符号 "public: static class phi::CustomRegisteredDeviceMap & __cdecl phi::CustomRegisteredDeviceMap::Instance(void)" (?Instance@CustomRegisteredDeviceMap@phi@@SAAEAV12@XZ)
nms_rotated.cu.obj : error LNK2001: 无法解析的外部符号 "public: static class phi::CustomRegisteredDeviceMap & __cdecl phi::CustomRegisteredDeviceMap::Instance(void)" (?Instance@CustomRegisteredDeviceMap@phi@@SAAEAV12@XZ)
rbox_iou.cu.obj : error LNK2001: 无法解析的外部符号 "public: static class phi::CustomRegisteredDeviceMap & __cdecl phi::CustomRegisteredDeviceMap::Instance(void)" (?Instance@CustomRegisteredDeviceMap@phi@@SAAEAV12@XZ)
matched_rbox_iou.cu.obj : error LNK2001: 无法解析的外部符号 "public: unsigned __int64 __cdecl phi::CustomRegisteredDeviceMap::GetOrRegisterGlobalDeviceTypeId(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?GetOrRegisterGlobalDeviceTypeId@CustomRegisteredDeviceMap@phi@@QEAA_KAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z)
nms_rotated.cu.obj : error LNK2001: 无法解析的外部符号 "public: unsigned __int64 __cdecl phi::CustomRegisteredDeviceMap::GetOrRegisterGlobalDeviceTypeId(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?GetOrRegisterGlobalDeviceTypeId@CustomRegisteredDeviceMap@phi@@QEAA_KAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z)
rbox_iou.cu.obj : error LNK2001: 无法解析的外部符号 "public: unsigned __int64 __cdecl phi::CustomRegisteredDeviceMap::GetOrRegisterGlobalDeviceTypeId(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?GetOrRegisterGlobalDeviceTypeId@CustomRegisteredDeviceMap@phi@@QEAA_KAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z)
build\ext_op\lib.win-amd64-3.10\ext_op.pyd : fatal error LNK1120: 4 个无法解析的外部命令
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\link.exe' failed with exit code 1120

F:\S_PaddleDetection-release-2.6\ppdet\ext_op>

@yocent
Copy link

yocent commented Apr 8, 2025

还是没好 paddle 2.6.2

@yocent
Copy link

yocent commented Apr 8, 2025

paddledet 2.6.0
paddlepaddle-gpu 2.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants