• Windows下caffe的配置和调用caffe库(二)


    二、 Caffe库的调用:

    1. 新建空白项目,将配置管理器更改为x64运行方式。(release和Debug均可)。
    2. Debug配置:

        1)      包含目录:

     

    1. D:caffe-masterinclude;
    2. D:NugetPackagesglog.0.3.3.0uild ativeinclude;
    3. D:NugetPackagesOpenBLAS.0.2.14.1lib ativeinclude;
    4. D:NugetPackagesOpenCV.2.4.10uild ativeinclude;
    5. D:NugetPackagesoost.1.59.0.0lib ativeinclude;
    6. D:NugetPackagesgflags.2.1.2.1uild ativeinclude;
    7. D:NugetPackageshdf5-v120-complete.1.8.15.2lib ativeinclude;
    8. D:NugetPackagesLevelDB-vc120.1.2.0.0uild ativeinclude;
    9. D:NugetPackageslmdb-v120-clean.0.9.14.0lib ativeinclude;
    10. D:NugetPackagesprotobuf-v120.2.6.1uild ativeinclude;

        2)      库目录:

     

    1. D:caffe-masterBuildx64Debug;
    2. D:NugetPackagesOpenCV.2.4.10uild ativelibx64v120Debug;
    3. D:NugetPackagesoost_chrono-vc120.1.59.0.0lib ativeaddress-model-64lib;
    4. D:NugetPackagesoost_date_time-vc120.1.59.0.0lib ativeaddress-model-64lib;
    5. D:NugetPackagesoost_filesystem-vc120.1.59.0.0lib ativeaddress-model-64lib;
    6. D:NugetPackagesoost_system-vc120.1.59.0.0lib ativeaddress-model-64lib;
    7. D:NugetPackagesoost_thread-vc120.1.59.0.0lib ativeaddress-model-64lib;
    8. D:NugetPackagesgflags.2.1.2.1uild ativex64v120dynamicLib;
    9. D:NugetPackagesglog.0.3.3.0uild ativelibx64v120Debugdynamic;
    10. D:NugetPackageshdf5-v120-complete.1.8.15.2lib ativelibx64;
    11. D:NugetPackagesLevelDB-vc120.1.2.0.0uild ativelibx64v120Debug;
    12. D:NugetPackageslmdb-v120-clean.0.9.14.0lib ativelibx64;
    13. D:NugetPackagesOpenBLAS.0.2.14.1lib ativelibx64;
    14. D:NugetPackagesprotobuf-v120.2.6.1uild ativelibx64v120Debug;
    15. D:NugetPackagesoost_date_time-vc120.1.59.0.0lib

        3)      链接器-->输入:

    caffe.lib

    compute_image_mean.lib

    convert_imageset.lib

    convert_mnist_data.lib

    libcaffe.lib

    opencv_highgui2410d.lib

    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-masterinclude
    2. D:NugetPackagesoost.1.59.0.0lib ativeinclude
    3. D:NugetPackagesgflags.2.1.2.1uild ativeinclude
    4. D:NugetPackagesglog.0.3.3.0uild ativeinclude
    5. D:NugetPackageshdf5-v120-complete.1.8.15.2lib ativeinclude
    6. D:NugetPackagesLevelDB-vc120.1.2.0.0uild ativeinclude
    7. D:NugetPackageslmdb-v120-clean.0.9.14.0lib ativeinclude
    8. D:NugetPackagesOpenBLAS.0.2.14.1lib ativeinclude
    9. D:NugetPackagesOpenCV.2.4.10uild ativeinclude
    10. D:NugetPackagesprotobuf-v120.2.6.1uild ativeinclude

    2)      库目录:

    也是和Debug模式下相似:

    1. D:caffe-masterBuildx64Release
    2. D:NugetPackagesoost_chrono-vc120.1.59.0.0lib ativeaddress-model-64lib
    3. D:NugetPackagesoost_date_time-vc120.1.59.0.0lib ativeaddress-model-64lib
    4. D:NugetPackagesoost_filesystem-vc120.1.59.0.0lib ativeaddress-model-64lib
    5. D:NugetPackagesoost_system-vc120.1.59.0.0lib ativeaddress-model-64lib
    6. D:NugetPackagesoost_thread-vc120.1.59.0.0lib ativeaddress-model-64lib
    7. D:NugetPackagesgflags.2.1.2.1uild ativex64v120dynamicLib
    8. D:NugetPackagesglog.0.3.3.0uild ativelibx64v120Releasedynamic
    9. D:NugetPackageshdf5-v120-complete.1.8.15.2lib ativelibx64
    10. D:NugetPackagesLevelDB-vc120.1.2.0.0uild ativelibx64v120Release
    11. D:NugetPackageslmdb-v120-clean.0.9.14.0lib ativelibx64
    12. D:NugetPackagesOpenBLAS.0.2.14.1lib ativelibx64
    13. D:NugetPackagesOpenCV.2.4.10uild ativelibx64v120Release
    14. D:NugetPackagesprotobuf-v120.2.6.1uild ativelibx64v120Release

        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-masterBuildx64下生成的Debug和release文件夹中的dll文件拷贝到项目所对应的Debug和release文件夹下。

     

    bug修复:

    1. 提示错误:

     

    解决:在链接器的命令行输入:-D_SCL_SECURE_NO_WARNINGS

      2. 提示错误:

     

    解决在路径:D:NugetPackagesgflags.2.1.2.1uild ativex64v120dynamicLib下。

    将对应的库文件拷贝到工程项目中。项目路径为E:Windows_caffecaffeTestx64Debug。

  • 相关阅读:
    还能这样偷懒?用Python实现网站自动签到脚本
    普通爬虫 VS 多线程爬虫!Python爬虫运行时间对比
    中文文献阅读方法及笔记模板
    约束
    可迭代对象补充
    练习题及补充
    内置函数的补充/super/异常值处理
    特殊成员
    嵌套
    面向对象知识点总结补充
  • 原文地址:https://www.cnblogs.com/Yu-FeiFei/p/6799438.html
Copyright © 2020-2023  润新知