Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何解决在windows 10上安装lightgbm gpu的问题?_Python_Boost_Cmake_Gpu_Lightgbm - Fatal编程技术网

Python 如何解决在windows 10上安装lightgbm gpu的问题?

Python 如何解决在windows 10上安装lightgbm gpu的问题?,python,boost,cmake,gpu,lightgbm,Python,Boost,Cmake,Gpu,Lightgbm,我正在尝试在Windows 10 pro x64上安装lightgbm gpu。我的GPU是NVIDIA Geforce GTX 950。 我试着先按照这个指南: 我用Mingw编译的地方。结果是,我可以成功地在python中导入LightGBM,但当我尝试使用参数device='gpu'来拟合模型时,出现了错误: 然后我遵循了指南: 在使用Visual Studio 2019成功编译后,我无法安装lightgbm的gpu版本:我总是会遇到与此处完全相同的错误: 我是否只是打字并不重要

我正在尝试在Windows 10 pro x64上安装lightgbm gpu。我的GPU是NVIDIA Geforce GTX 950。

我试着先按照这个指南: 我用Mingw编译的地方。结果是,我可以成功地在python中导入LightGBM,但当我尝试使用参数
device
='gpu'来拟合模型时,出现了错误:


然后我遵循了指南: 在使用Visual Studio 2019成功编译后,我无法安装lightgbm的gpu版本:我总是会遇到与此处完全相同的错误:

我是否只是打字并不重要


或者告诉我的boost和cuda的路线

我也尝试过各种版本的boost,但总是出现同样的错误。如果有人向我解释问题所在,我将不胜感激。

在Python/Anaconda/Windows 8.1/10 x64上安装支持GPU的Lightgbm的终极指南。 要安装支持GPU的Lightgmb,您需要从源代码重新构建,没有其他方法

你需要的东西:

1)Visual Studio 20xxxx=15,社区可以。)

在Windows 8.1上:需要另外安装Windows SDK 8.1版。它未安装在标准安装中,因此您可以进行自定义安装,或者,如果您已经安装了它,则可以通过添加Windows SDK 8.1版来修改安装

2)在默认文件夹
C:/local
中下载并安装文件(version 1\u 56\u 0或更高版本)。您需要在某些命令中更改这些数字,以分别与您自己的BoosterVisual Studio版本相匹配。当心

3)

4)

如果在Anaconda上安装,请在继续之前激活正确的环境

现在转到命令行:

git clone --recursive https://github.com/microsoft/LightGBM   
cd LightGBM
mkdir build
cd build
cmake -A x64 -DUSE_GPU=1 -DBOOST_ROOT= -DBOOST_LIBRARYDIR=C:/local/boost_1_71_0/lib64-msvc-14.0 .. 

-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version  to target Windows 10.0.18362.
-- The C compiler identification is MSVC 19.0.24215.1
   ...................
   ...................
-- Build files have been written to: J:/LightGBM/build
现在您调用cmakegui,并且(在填充源代码在哪里构建二进制文件在哪里字段之后),您应该看到如下内容:

如果未选中使用\u GPU使用\u OPENMP,请在继续之前进行检查

单击配置,然后单击生成

关闭CMake

现在你打字

cmake --build . --target ALL_BUILD --config Release
此时,您将发现LightGBM文件夹中有一个Release文件夹。太好了

然后,最后


就是这些人。

这是我的错误[链接]()
pip install lightgbm --install-option=--gpu --install-option="--opencl- 
include-dir=C:/Program Files/NVIDIA GPU Computing 
Toolkit/CUDA/v10.1/include" --install-option="--opencl-library=C:/Program 
Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/lib/x64/OpenCL.lib" -- 
install-option="--boost-librarydir= C:/local/boost_1_69_0/lib64-msvc-14.1" 
--install-option="--boost-root= C:/local/boost_1_69_0"
git clone --recursive https://github.com/microsoft/LightGBM   
cd LightGBM
mkdir build
cd build
cmake -A x64 -DUSE_GPU=1 -DBOOST_ROOT= -DBOOST_LIBRARYDIR=C:/local/boost_1_71_0/lib64-msvc-14.0 .. 

-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version  to target Windows 10.0.18362.
-- The C compiler identification is MSVC 19.0.24215.1
   ...................
   ...................
-- Build files have been written to: J:/LightGBM/build
cmake --build . --target ALL_BUILD --config Release
cd ..\python-package
python setup.py install --gpu

running install
INFO:LightGBM:Starting to compile the library.
INFO:LightGBM:Starting to compile with Visual Studio 16 2019.
INFO:LightGBM:Starting to compile with Visual Studio 15 2017.
INFO:LightGBM:Starting to compile with Visual Studio 14 2015.
running build
running build_py
creating build
creating build\lib
creating build\lib\lightgbm
.......