这个问题是针对以Keras为前端的Python2.7的。我拥有Microsoft Visual Studio 2017,我相信我拥有它需要的所有工具。我按照install CUDA上的说明进行操作。我相信它是版本10,并且我认为它已正确安装。我遵循了tutorial video,并在样本测试的最后得到了相似的结果。现在,我开始安装libgpuarray。我已完成以下步骤,并收到此错误:
C:\Windows\system32>cd C:\Users\Never\Downloads\libgpuarray
C:\Users\Never\Downloads\libgpuarray>cd Build
C:\Users\Never\Downloads\libgpuarray\Build>cmake .. -DCMAKE_BUILD_TYPE=Release
-- Building for: Visual Studio 15 2017
-- The C compiler identification is MSVC 19.16.27034.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Deprecation Warning at CMakeLists.txt:26 (cmake_policy):
The OLD behavior for policy CMP0063 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- Looking for strlcat
-- Looking for strlcat - not found
-- Looking for mkstemp
-- Looking for mkstemp - not found
-- Found PkgConfig: C:/MinGW_w64/bin/pkg-config.exe (found version "0.25")
-- Checking for one of the modules 'check'
Tests disabled because Check was not found
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_BUILD_TYPE
-- Build files have been written to: C:/Users/Never/Downloads/libgpuarray/Build
我接下来尝试运行C:\Users\Never\Downloads\libgpuarray\Build>make
,但返回了:
'make' is not recognized as an internal or external command,operable program or batch file.
上面的文件夹中有一个make
脚本,因此我尝试使用它,结果如下:
C:\Users\Never\Downloads\libgpuarray\Build>C:\Users\Never\Downloads\libgpuarray\make.bat
C:\Users\Never\Downloads\libgpuarray\Build>REM This helps repetitive builds on windows
C:\Users\Never\Downloads\libgpuarray\Build>REM It needs the compiler you want to use to be available in the shell
C:\Users\Never\Downloads\libgpuarray\Build>REM and it will build a release version
C:\Users\Never\Downloads\libgpuarray\Build>del bld
Could Not Find C:\Users\Never\Downloads\libgpuarray\Build\bld
C:\Users\Never\Downloads\libgpuarray\Build>mkdir bld
C:\Users\Never\Downloads\libgpuarray\Build>cd bld
C:\Users\Never\Downloads\libgpuarray\Build\bld>cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release
CMake Error: Error: generator : NMake Makefiles
Does not match the generator used previously: Visual Studio 15 2017
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
C:\Users\Never\Downloads\libgpuarray\Build\bld>cmake --build . --config Release
Error: could not load cache
C:\Users\Never\Downloads\libgpuarray\Build\bld>cd ..
我不确定100%接下来该做什么。我不想修补和进一步破坏,谢谢您的帮助。
答案 0 :(得分:1)
您似乎正在遵循所链接教程中的Linux instructions。考虑到您正在使用Visual Studio在Windows上进行构建,您可能应该看看Windows-specific instructions。
听起来您可能已经通过运行make.bat
文件而稍微破坏了CMake缓存,所以最好删除Build
文件夹并重新开始:
C:\Users\Never\Downloads\libgpuarray>mkdir Build && cd Build
C:\Users\Never\Downloads\libgpuarray\Build>cmake ..
从那里开始,只需遵循本教程中的 Windows特定准则:
它将为安装的版本生成一个Visual Studio解决方案文件。要构建项目,请打开此文件(.sln),然后在选择适当的构建类型后运行“全部构建”命令。