如何在VS2013中使用caffe接口

2024-12-26 19:51:17
推荐回答(1个)
回答1:

 观察caffe-master的第三方程序包,这个与caffe-master本文件夹都需要加上去的。所以在属性表里,先后需要include以下这些:(路径请自行修改)

  D:\caffe-master\include
  D:\NugetPackages\boost.1.59.0.0\lib\native\include
  D:\NugetPackages\glog.0.3.3.0\build\native\include
  D:\NugetPackages\gflags.2.1.2.1\build\native\include
  D:\NugetPackages\protobuf-v120.2.6.1\build\native\include
  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include
  D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\include
  D:\caffe-master\include\caffe\layers
  D:\NugetPackages\OpenCV.2.4.10\build\native\include
  D:\NugetPackages\OpenCV.2.4.10\build\native\include\opencv
  D:\NugetPackages\OpenCV.2.4.10\build\native\include\opencv2

  最后一项是CUDA的配置路径,找一下应该就可以找到。
  那么我们的附加依赖项需要添加:

  libcaffe.lib
  libprotobuf.lib
  opencv_highgui2410.lib
  opencv_core2410.lib
  opencv_imgproc2410.lib
  libglog.lib
  gflags.lib
  libopenblas.dll.a
  hdf5.lib
  hdf5_hl.lib
  cublas.lib
  cublas_device.lib
  cuda.lib
  cudadevrt.lib
  cudnn.lib
  cudart.lib
  cufft.lib
  cudart_static.lib
  cufftw.lib
  cusparse.lib
  cusolver.lib
  curand.lib
  nppc.lib
  OpenCL.lib

  对了,最后别忘了配置环境变量哟,配置完之后重启一遍:

  D:\NugetPackages\gflags.2.1.2.1\build\native\x64\v120\dynamic\Lib
  D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\bin\x64
  D:\NugetPackages\glog.0.3.3.0\build\native\bin\x64\v120\Release\dynamic
  D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\bin\x64
  D:\NugetPackages\gflags.2.1.2.1\build\native\x64\v120\dynamic\Lib
  D:\NugetPackages\OpenCV.2.4.10\build\native\bin\x64\v120\Release
  D:\caffe-master\Build\x64\Release
  
  那么在做完这些之后,我们就可以在新建工程里使用Caffe的接口了