Windows下caffe的配置和調用caffe庫(二)

2、 Caffe庫的調用:ui

  1. 新建空白項目,將配置管理器更改成x64運行方式。(release和Debug都可)。
  2. Debug配置:

    1)      包含目錄:命令行

 

  1. D:\caffe-master\include;
  2. D:\NugetPackages\glog.0.3.3.0\build\native\include;
  3. D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\include;
  4. D:\NugetPackages\OpenCV.2.4.10\build\native\include;
  5. D:\NugetPackages\boost.1.59.0.0\lib\native\include;
  6. D:\NugetPackages\gflags.2.1.2.1\build\native\include;
  7. D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\include;
  8. D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\include;
  9. D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\include;
  10. D:\NugetPackages\protobuf-v120.2.6.1\build\native\include;

    2)      庫目錄:3d

 

  1. D:\caffe-master\Build\x64\Debug;
  2. D:\NugetPackages\OpenCV.2.4.10\build\native\lib\x64\v120\Debug;
  3. D:\NugetPackages\boost_chrono-vc120.1.59.0.0\lib\native\address-model-64\lib;
  4. D:\NugetPackages\boost_date_time-vc120.1.59.0.0\lib\native\address-model-64\lib;
  5. D:\NugetPackages\boost_filesystem-vc120.1.59.0.0\lib\native\address-model-64\lib;
  6. D:\NugetPackages\boost_system-vc120.1.59.0.0\lib\native\address-model-64\lib;
  7. D:\NugetPackages\boost_thread-vc120.1.59.0.0\lib\native\address-model-64\lib;
  8. D:\NugetPackages\gflags.2.1.2.1\build\native\x64\v120\dynamic\Lib;
  9. D:\NugetPackages\glog.0.3.3.0\build\native\lib\x64\v120\Debug\dynamic;
  10. D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\lib\x64;
  11. D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\lib\x64\v120\Debug;
  12. D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\lib\x64;
  13. D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\lib\x64;
  14. D:\NugetPackages\protobuf-v120.2.6.1\build\native\lib\x64\v120\Debug;
  15. D:\NugetPackages\boost_date_time-vc120.1.59.0.0\lib

    3)      連接器-->輸入:blog

caffe.libip

compute_image_mean.libget

convert_imageset.lib編譯

convert_mnist_data.libopencv

libcaffe.libast

opencv_highgui2410d.libthread

opencv_imgproc2410d.lib

opencv_objdetect2410d.lib

opencv_core2410d.lib

opencv_ml2410d.lib

libboost_date_time-vc120-mt-gd-1_59.lib

libboost_filesystem-vc120-mt-gd-1_59.lib

libboost_system-vc120-mt-gd-1_59.lib

libglog.lib

hdf5.lib

hdf5_cpp.lib

hdf5_f90cstub.lib

hdf5_fortran.lib

hdf5_hl.lib

hdf5_hl_cpp.lib

hdf5_hl_f90cstub.lib

hdf5_hl_fortran.lib

hdf5_tools.lib

szip.lib

zlib.lib

LevelDb.lib

lmdb.lib

libprotobuf.lib

libopenblas.dll.a

gflags_nothreadsd.lib

gflagsd.lib

  3.      release編譯配置:

    1)      包含目錄:

和上面Debug模式下配置相同:

 

  1. D:\caffe-master\include
  2. D:\NugetPackages\boost.1.59.0.0\lib\native\include
  3. D:\NugetPackages\gflags.2.1.2.1\build\native\include
  4. D:\NugetPackages\glog.0.3.3.0\build\native\include
  5. D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\include
  6. D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\include
  7. D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\include
  8. D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\include
  9. D:\NugetPackages\OpenCV.2.4.10\build\native\include
  10. D:\NugetPackages\protobuf-v120.2.6.1\build\native\include

2)      庫目錄:

也是和Debug模式下類似:

  1. D:\caffe-master\Build\x64\Release
  2. D:\NugetPackages\boost_chrono-vc120.1.59.0.0\lib\native\address-model-64\lib
  3. D:\NugetPackages\boost_date_time-vc120.1.59.0.0\lib\native\address-model-64\lib
  4. D:\NugetPackages\boost_filesystem-vc120.1.59.0.0\lib\native\address-model-64\lib
  5. D:\NugetPackages\boost_system-vc120.1.59.0.0\lib\native\address-model-64\lib
  6. D:\NugetPackages\boost_thread-vc120.1.59.0.0\lib\native\address-model-64\lib
  7. D:\NugetPackages\gflags.2.1.2.1\build\native\x64\v120\dynamic\Lib
  8. D:\NugetPackages\glog.0.3.3.0\build\native\lib\x64\v120\Release\dynamic
  9. D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\lib\x64
  10. D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\lib\x64\v120\Release
  11. D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\lib\x64
  12. D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\lib\x64
  13. D:\NugetPackages\OpenCV.2.4.10\build\native\lib\x64\v120\Release
  14. D:\NugetPackages\protobuf-v120.2.6.1\build\native\lib\x64\v120\Release

    3)      連接器-->輸入:

 

opencv_core2410.lib

opencv_highgui2410.lib

opencv_imgproc2410.lib

caffe.lib

libcaffe.lib

gflags.lib

libglog.lib

libopenblas.dll.a

libprotobuf.lib

leveldb.lib

lmdb.lib

hdf5.lib

hdf5_hl.lib

libboost_date_time-vc120-mt-s-1_59.lib

libboost_filesystem-vc120-mt-s-1_59.lib

 

note:

先將D:\caffe-master\Build\x64下生成的Debug和release文件夾中的dll文件拷貝到項目所對應的Debug和release文件夾下。

 

bug修復:

  1. 提示錯誤:

 

解決:在連接器的命令行輸入:-D_SCL_SECURE_NO_WARNINGS

  2. 提示錯誤:

 

解決在路徑:D:\NugetPackages\gflags.2.1.2.1\build\native\x64\v120\dynamic\Lib下。

將對應的庫文件拷貝到工程項目中。項目路徑爲E:\Windows_caffe\caffeTest\x64\Debug。

相關文章
相關標籤/搜索