gpt4 book ai didi

python - Python 的 Lightgbm GPU 安装

转载 作者:太空宇宙 更新时间:2023-11-03 21:04:13 27 4
gpt4 key购买 nike

第一次尝试-) 我安装了 CMake、Mingw、Boost 并且已经有了 VS 2017 社区版本。我使用this成功安装了它指导。我什至在 Git Bash 上测试过它并且它有效。但我想这不适用于Python?因为我无法在 Python IDLE、Notebook 等上导入和使用它。

第二次尝试-)另外,我使用this通过VS安装了它。指导。它说.exe 文件将位于 LightGBM-master/windows/x64/Release 文件夹中。 我想这个指南是为 VS 用户准备的,而不是为我准备的?

第三次尝试-) pip install lightgbm --install-option=--gpu给我错误:异常:请先安装 CMake我已经有了 CMake,并将 CMake 添加到系统和用户路径中。

C:\Program Files\CMake\bin

还给出有关 Boost 变量的警告,但在第一次尝试中,我能够使用 Boost 安装 lightgbm。

LightGBM_compilation.txt 更详细地显示错误:

-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
-- The C compiler identification is MSVC 19.16.27026.1
-- The CXX compiler identification is MSVC 19.16.27026.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
-- Looking for CL_VERSION_2_2
-- Looking for CL_VERSION_2_2 - not found
-- Looking for CL_VERSION_2_1
-- Looking for CL_VERSION_2_1 - not found
-- Looking for CL_VERSION_2_0
-- Looking for CL_VERSION_2_0 - not found
-- Looking for CL_VERSION_1_2
-- Looking for CL_VERSION_1_2 - found
-- Found OpenCL: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/lib/x64/OpenCL.lib (found version "1.2")
-- OpenCL include directory:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/include CMake Warning (dev) at CMakeLists.txt:97 (find_package): Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables. Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Environment variable Boost_ROOT is set to:

C:\boost\boost_1_69_0

For compatibility, CMake is ignoring the variable. This warning is for project developers. Use -Wno-dev to suppress it.

-- Boost version: 1.69.0
-- Found the following Boost libraries:
-- filesystem
-- system
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/dogus/AppData/Local/Temp/pip-install-1uszztyz/lightgbm/build_cpp Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.

Build started 4/5/2019 10:42:58 AM. Project "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj" on node 1 (default targets). Project "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj" (1) is building "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\ZERO_CHECK.vcxproj" (2) on node 1 (default targets). PrepareForBuild: Creating directory "x64\Release\ZERO_CHECK\". C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\ZERO_CHECK.vcxproj] Creating directory "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\". InitializeBuildStatus: Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. CustomBuild: Checking Build System CMake does not need to re-run because C:/Users/dogus/AppData/Local/Temp/pip-install-1uszztyz/lightgbm/build_cpp/CMakeFiles/generate.stamp is up-to-date. FinalizeBuildStatus: Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild". Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate". Done Building Project "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\ZERO_CHECK.vcxproj" (default targets). PrepareForBuild: Creating directory "_lightgbm.dir\Release\". C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] Creating directory "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\Release\". Creating directory "_lightgbm.dir\Release\_lightgbm.tlog\". InitializeBuildStatus: Creating "_lightgbm.dir\Release\_lightgbm.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. CustomBuild: Building Custom Rule C:/Users/dogus/AppData/Local/Temp/pip-install-1uszztyz/lightgbm/compile/CMakeLists.txt CMake does not need to re-run because C:/Users/dogus/AppData/Local/Temp/pip-install-1uszztyz/lightgbm/build_cpp/CMakeFiles/generate.stamp is up-to-date. ClCompile: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\CL.exe /c /I"C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\compute\include" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include" /IC:\boost\boost_1_69_0 /I"C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\include" /nologo /W4 /WX- /diagnostics:classic /MP /O2 /Ob2 /Oi /Ot /Oy /GL /D WIN32 /D _WINDOWS /D NDEBUG /D USE_SOCKET /D BOOST_ALL_NO_LIB /D USE_GPU /D "CMAKE_INTDIR=\"Release\"" /D _lightgbm_EXPORTS /D _WINDLL /D _MBCS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /openmp /Fo"_lightgbm.dir\Release\\" /Fd"_lightgbm.dir\Release\vc141.pdb" /Gd /TP /errorReport:queue "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\c_api.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\lightgbm_R.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\application\application.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\boosting\boosting.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\boosting\gbdt.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\boosting\gbdt_model_text.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\boosting\gbdt_prediction.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\boosting\prediction_early_stop.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\io\bin.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\io\config.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\io\config_auto.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\io\dataset.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\io\dataset_loader.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\io\file_io.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\io\json11.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\io\metadata.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\io\parser.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\io\tree.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\metric\dcg_calculator.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\metric\metric.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\network\linker_topo.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\network\linkers_mpi.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\network\linkers_socket.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\network\network.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\objective\objective_function.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\treelearner\data_parallel_tree_learner.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\treelearner\feature_parallel_tree_learner.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\treelearner\gpu_tree_learner.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\treelearner\serial_tree_learner.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\treelearner\tree_learner.cpp" "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\src\treelearner\voting_parallel_tree_learner.cpp" c_api.cpp lightgbm_R.cpp application.cpp boosting.cpp gbdt.cpp gbdt_model_text.cpp gbdt_prediction.cpp prediction_early_stop.cpp bin.cpp config.cpp config_auto.cpp dataset.cpp dataset_loader.cpp file_io.cpp json11.cpp metadata.cpp parser.cpp tree.cpp dcg_calculator.cpp metric.cpp linker_topo.cpp linkers_mpi.cpp linkers_socket.cpp network.cpp objective_function.cpp data_parallel_tree_learner.cpp feature_parallel_tree_learner.cpp gpu_tree_learner.cpp serial_tree_learner.cpp tree_learner.cpp voting_parallel_tree_learner.cpp Link: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\Release\lib_lightgbm.dll" /INCREMENTAL:NO /NOLOGO "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\lib\x64\OpenCL.lib" "C:\boost\boost-build\lib\libboost_filesystem.a" "C:\boost\boost-build\lib\libboost_system.a" kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"C:/Users/dogus/AppData/Local/Temp/pip-install-1uszztyz/lightgbm/compile/Release/lib_lightgbm.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/Users/dogus/AppData/Local/Temp/pip-install-1uszztyz/lightgbm/compile/Release/lib_lightgbm.lib" /MACHINE:X64 /machine:x64 /DLL _lightgbm.dir\Release\c_api.obj
_lightgbm.dir\Release\lightgbm_R.obj _lightgbm.dir\Release\application.obj _lightgbm.dir\Release\boosting.obj _lightgbm.dir\Release\gbdt.obj _lightgbm.dir\Release\gbdt_model_text.obj _lightgbm.dir\Release\gbdt_prediction.obj _lightgbm.dir\Release\prediction_early_stop.obj _lightgbm.dir\Release\bin.obj _lightgbm.dir\Release\config.obj _lightgbm.dir\Release\config_auto.obj _lightgbm.dir\Release\dataset.obj _lightgbm.dir\Release\dataset_loader.obj _lightgbm.dir\Release\file_io.obj _lightgbm.dir\Release\json11.obj _lightgbm.dir\Release\metadata.obj _lightgbm.dir\Release\parser.obj _lightgbm.dir\Release\tree.obj _lightgbm.dir\Release\dcg_calculator.obj _lightgbm.dir\Release\metric.obj _lightgbm.dir\Release\linker_topo.obj _lightgbm.dir\Release\linkers_mpi.obj _lightgbm.dir\Release\linkers_socket.obj _lightgbm.dir\Release\network.obj _lightgbm.dir\Release\objective_function.obj _lightgbm.dir\Release\data_parallel_tree_learner.obj _lightgbm.dir\Release\feature_parallel_tree_learner.obj _lightgbm.dir\Release\gpu_tree_learner.obj _lightgbm.dir\Release\serial_tree_learner.obj _lightgbm.dir\Release\tree_learner.obj _lightgbm.dir\Release\voting_parallel_tree_learner.obj c_api.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
Creating library C:/Users/dogus/AppData/Local/Temp/pip-install-1uszztyz/lightgbm/compile/Release/lib_lightgbm.lib and object C:/Users/dogus/AppData/Local/Temp/pip-install-1uszztyz/lightgbm/compile/Release/lib_lightgbm.exp gpu_tree_learner.obj : error LNK2001: unresolved external symbol "void
__cdecl boost::filesystem::path_traits::convert(char const *,char const *,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,class std::codecvt<wchar_t,char,struct _Mbstatet> const &)" (?convert@path_traits@filesystem@boost@@YAXPEBD0AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV?$codecvt@_WDU_Mbstatet@@@5@@Z) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] gpu_tree_learner.obj : error LNK2001: unresolved external symbol "void
__cdecl boost::filesystem::path_traits::convert(wchar_t const *,wchar_t const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::codecvt<wchar_t,char,struct _Mbstatet> const &)" (?convert@path_traits@filesystem@boost@@YAXPEB_W0AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV?$codecvt@_WDU_Mbstatet@@@5@@Z) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] gpu_tree_learner.obj : error LNK2001: unresolved external symbol "class boost::filesystem::file_status __cdecl boost::filesystem::detail::status(class boost::filesystem::path const &,class boost::system::error_code *)" (?status@detail@filesystem@boost@@YA?AVfile_status@23@AEBVpath@23@PEAVerror_code@system@3@@Z) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] gpu_tree_learner.obj : error LNK2001: unresolved external symbol "bool
__cdecl boost::filesystem::detail::create_directories(class boost::filesystem::path const &,class boost::system::error_code *)" (?create_directories@detail@filesystem@boost@@YA_NAEBVpath@23@PEAVerror_code@system@3@@Z) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] gpu_tree_learner.obj : error LNK2001: unresolved external symbol "public: static class std::codecvt<wchar_t,char,struct _Mbstatet> const & __cdecl boost::filesystem::path::codecvt(void)" (?codecvt@path@filesystem@boost@@SAAEBV?$codecvt@_WDU_Mbstatet@@@std@@XZ) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] gpu_tree_learner.obj : error LNK2001: unresolved external symbol "public: class boost::filesystem::path & __cdecl boost::filesystem::path::make_preferred(void)" (?make_preferred@path@filesystem@boost@@QEAAAEAV123@XZ) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\Release\lib_lightgbm.dll : fatal error LNK1120: 6 unresolved externals [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] Done Building Project "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj" (default target) (1) -> "C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\ZERO_CHECK.vcxproj" (default target) (2) -> (PrepareForBuild target) -> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\ZERO_CHECK.vcxproj]


"C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj" (default target) (1) -> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj]


"C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj" (default target) (1) -> (Link target) -> gpu_tree_learner.obj : error LNK2001: unresolved external symbol "void __cdecl boost::filesystem::path_traits::convert(char const *,char const
*,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,class std::codecvt<wchar_t,char,struct _Mbstatet> const &)" (?convert@path_traits@filesystem@boost@@YAXPEBD0AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV?$codecvt@_WDU_Mbstatet@@@5@@Z) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] gpu_tree_learner.obj : error LNK2001: unresolved external symbol "void
__cdecl boost::filesystem::path_traits::convert(wchar_t const *,wchar_t const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::codecvt<wchar_t,char,struct _Mbstatet> const &)" (?convert@path_traits@filesystem@boost@@YAXPEB_W0AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV?$codecvt@_WDU_Mbstatet@@@5@@Z) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] gpu_tree_learner.obj : error LNK2001: unresolved external symbol "class boost::filesystem::file_status __cdecl boost::filesystem::detail::status(class boost::filesystem::path const &,class boost::system::error_code *)" (?status@detail@filesystem@boost@@YA?AVfile_status@23@AEBVpath@23@PEAVerror_code@system@3@@Z) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] gpu_tree_learner.obj : error LNK2001: unresolved external symbol "bool
__cdecl boost::filesystem::detail::create_directories(class boost::filesystem::path const &,class boost::system::error_code *)" (?create_directories@detail@filesystem@boost@@YA_NAEBVpath@23@PEAVerror_code@system@3@@Z) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] gpu_tree_learner.obj : error LNK2001: unresolved external symbol "public: static class std::codecvt<wchar_t,char,struct _Mbstatet> const & __cdecl boost::filesystem::path::codecvt(void)" (?codecvt@path@filesystem@boost@@SAAEBV?$codecvt@_WDU_Mbstatet@@@std@@XZ) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] gpu_tree_learner.obj : error LNK2001: unresolved external symbol "public: class boost::filesystem::path & __cdecl boost::filesystem::path::make_preferred(void)" (?make_preferred@path@filesystem@boost@@QEAAAEAV123@XZ) [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj] C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\compile\Release\lib_lightgbm.dll : fatal error LNK1120: 6 unresolved externals [C:\Users\dogus\AppData\Local\Temp\pip-install-1uszztyz\lightgbm\build_cpp\_lightgbm.vcxproj]

2 Warning(s)
7 Error(s)

Time Elapsed 00:00:16.81

最佳答案

问题是我从本指南中获得了 boost 文件,但它不是我想要的 python 安装。 https://lightgbm.readthedocs.io/en/latest/GPU-Windows.html

那个 boost 文件没有这个库/lib64-msvc-14.1我安装了boost_1_69_0-msvc-14.1-64.exe,这是我从here获得的.

我添加了 boost 参数并且它起作用了!

pip install lightgbm --install-option=--gpu --install-option="--boost-root=C:/local/boost_1_69_0" --install-option="--boost-librarydir=C:/local/boost_1_69_0/lib64-msvc-14.1"

每次尝试 pip install 时,我都会遇到以下异常。如果有人遇到同样的问题,我希望这个解决方案对他们有用。

Exception: Please install CMake first

关于python - Python 的 Lightgbm GPU 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55534466/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com