• Caffe 编译


    Compilation

    Now that you have the prerequisites, edit your Makefile.config to change the paths for your setup The defaults should work, but uncomment the relevant lines if using Anaconda Python.

    cp Makefile.config.example Makefile.config
    # Adjust Makefile.config (for example, if using Anaconda Python)
    make all
    make test
    make runtest
    
    • For cuDNN acceleration, you should uncomment the USE_CUDNN := 1 switch in Makefile.config.
    • For CPU-only Caffe, uncomment CPU_ONLY := 1 in Makefile.config.

    To compile the Python and MATLAB wrappers do make pycaffe and make matcaffe respectively. Be sure to set your MATLAB and Python paths in Makefile.config first!

    Distribution: run make distribute to create a distribute directory with all the Caffe headers, compiled libraries, binaries, etc. needed for distribution to other machines.

    Speed: for a faster build, compile in parallel by doing make all -j8 where 8 is the number of parallel threads for compilation (a good choice for the number of threads is the number of cores in your machine).

    Now that you have installed Caffe, check out the MNIST tutorial and the reference ImageNet model tutorial.

    CMake Compilation

    In lieu of manually editing Makefile.config to configure the build, Caffe offers an unofficial CMake build thanks to @Nerei, @akosiorek, and other members of the community. It requires CMake version >= 2.8.7. The basic steps are as follows:

    mkdir build
    cd build
    cmake ..
    make all
    make runtest
    

    See PR #1667 for options and details.

    Hardware

    Laboratory Tested Hardware: Berkeley Vision runs Caffe with K40s, K20s, and Titans including models at ImageNet/ILSVRC scale. We also run on GTX series cards (980s and 770s) and GPU-equipped MacBook Pros. We have not encountered any trouble in-house with devices with CUDA capability >= 3.0. All reported hardware issues thus-far have been due to GPU configuration, overheating, and the like.

    CUDA compute capability: devices with compute capability <= 2.0 may have to reduce CUDA thread numbers and batch sizes due to hardware constraints. Your mileage may vary.

    Once installed, check your times against our reference performance numbers to make sure everything is configured properly.

    Ask hardware questions on the caffe-users group.

  • 相关阅读:
    Spring Bean的生命周期
    使用docker安装虚拟机并打开ssh连接
    查看/设置JVM使用的垃圾收集器
    使用Apollo动态修改线上数据源
    java8之lambda表达式
    Java8之Stream
    @Bean 的用法
    Java中的Filter过滤器
    详解tomcat的连接数与线程池
    什么是ClassLoader
  • 原文地址:https://www.cnblogs.com/sdlypyzq/p/4839865.html
Copyright © 2020-2023  润新知