在windows环境下编译CPU版本caffe通过。
在工程中调用caffe时遇到:“cublas_v2.h: No such file or directory”。
解决方案:
(1)工程 -> 属性 -> 配置属性\C/C++ -> 预处理器 -> 预处理器定义中添加 CPU_ONLY;
避免在项目中调用到cuda文件。
(2)若(1)不行,配置Microsoft/caffe项目中CommonSettings.props,
除了设置CPUOnly为true:
<!--NOTE: CpuOnlyBuild and UseCuDNN flags can't be set at the same time.-->
<CpuOnlyBuild>true</CpuOnlyBuild>
<UseCuDNN>false</UseCuDNN>
<CudaVersion>7.5</CudaVersion>
将以下内容分删除:
<PropertyGroup Condition="'$(CpuOnlyBuild)'=='false'">
<CudaDependencies>cublas.lib;cuda.lib;curand.lib;cudart.lib</CudaDependencies>
</PropertyGroup>
<PropertyGroup Condition="'$(UseCuDNN)'=='true'">
<CudaDependencies>cudnn.lib;$(CudaDependencies)</CudaDependencies>
</PropertyGroup>
<PropertyGroup Condition="'$(UseCuDNN)'=='true' And $(CuDnnPath)!=''">
<LibraryPath>$(CuDnnPath)\cuda\lib\x64;$(LibraryPath)</LibraryPath>
<IncludePath>$(CuDnnPath)\cuda\include;$(IncludePath)</IncludePath>
</PropertyGroup>
之后重新编译caffe。
或者在文件中添加
#define CPU_ONLY
注:管理器使用Release x86.