2、 Caffe庫的調用:ui
- 新建空白項目,將配置管理器更改成x64運行方式。(release和Debug都可)。
- Debug配置:
1) 包含目錄:命令行
- D:\caffe-master\include;
- D:\NugetPackages\glog.0.3.3.0\build\native\include;
- D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\include;
- D:\NugetPackages\OpenCV.2.4.10\build\native\include;
- D:\NugetPackages\boost.1.59.0.0\lib\native\include;
- D:\NugetPackages\gflags.2.1.2.1\build\native\include;
- D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\include;
- D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\include;
- D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\include;
- D:\NugetPackages\protobuf-v120.2.6.1\build\native\include;
2) 庫目錄:3d
- D:\caffe-master\Build\x64\Debug;
- D:\NugetPackages\OpenCV.2.4.10\build\native\lib\x64\v120\Debug;
- D:\NugetPackages\boost_chrono-vc120.1.59.0.0\lib\native\address-model-64\lib;
- D:\NugetPackages\boost_date_time-vc120.1.59.0.0\lib\native\address-model-64\lib;
- D:\NugetPackages\boost_filesystem-vc120.1.59.0.0\lib\native\address-model-64\lib;
- D:\NugetPackages\boost_system-vc120.1.59.0.0\lib\native\address-model-64\lib;
- D:\NugetPackages\boost_thread-vc120.1.59.0.0\lib\native\address-model-64\lib;
- D:\NugetPackages\gflags.2.1.2.1\build\native\x64\v120\dynamic\Lib;
- D:\NugetPackages\glog.0.3.3.0\build\native\lib\x64\v120\Debug\dynamic;
- D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\lib\x64;
- D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\lib\x64\v120\Debug;
- D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\lib\x64;
- D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\lib\x64;
- D:\NugetPackages\protobuf-v120.2.6.1\build\native\lib\x64\v120\Debug;
- 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模式下配置相同:
- D:\caffe-master\include
- D:\NugetPackages\boost.1.59.0.0\lib\native\include
- D:\NugetPackages\gflags.2.1.2.1\build\native\include
- D:\NugetPackages\glog.0.3.3.0\build\native\include
- D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\include
- D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\include
- D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\include
- D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\include
- D:\NugetPackages\OpenCV.2.4.10\build\native\include
- D:\NugetPackages\protobuf-v120.2.6.1\build\native\include
2) 庫目錄:
也是和Debug模式下類似:
- D:\caffe-master\Build\x64\Release
- D:\NugetPackages\boost_chrono-vc120.1.59.0.0\lib\native\address-model-64\lib
- D:\NugetPackages\boost_date_time-vc120.1.59.0.0\lib\native\address-model-64\lib
- D:\NugetPackages\boost_filesystem-vc120.1.59.0.0\lib\native\address-model-64\lib
- D:\NugetPackages\boost_system-vc120.1.59.0.0\lib\native\address-model-64\lib
- D:\NugetPackages\boost_thread-vc120.1.59.0.0\lib\native\address-model-64\lib
- D:\NugetPackages\gflags.2.1.2.1\build\native\x64\v120\dynamic\Lib
- D:\NugetPackages\glog.0.3.3.0\build\native\lib\x64\v120\Release\dynamic
- D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\lib\x64
- D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\lib\x64\v120\Release
- D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\lib\x64
- D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\lib\x64
- D:\NugetPackages\OpenCV.2.4.10\build\native\lib\x64\v120\Release
- 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修復:
- 提示錯誤:
解決:在連接器的命令行輸入:-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。