半醉残影 - Caffe
type: channel
link: https://mars.dengyb.com/category/Caffe/
description: 主流机器学习框架，C++编写，性能较高，使用方便
items: [常见错误]Attempting to use an MPI routine before initializing MPI
items: Caffe Int8量化推理
items: 安装Caffe

[常见错误]Attempting to use an MPI routine before initializing MPI
type: item
date: 2018-10-31T14:39:13+08:00
description: 前言在使用intel caffe with MKLDNN时候，遇到一个问题一直解决不了，后来问了同事才发现他也遇到了。Attempting to use an MPI routine before initializing MPI[...]

Caffe Int8量化推理
type: item
date: 2018-09-20T13:43:00+08:00
description: 前言8位（INT8）推理也称为低精度推理，它可以以较低的精度损失加速推理。与FP32相比，它具有更高的吞吐量和更低的存储器需求。Intel发布了一个精确工具（Calibrator）。该工具将首先生成初始量化参数，并尝试调整它们以满足以后的精度要求。它最终会产生一个量化的原型TXTXT。 [...]

安装Caffe
type: item
date: 2018-05-30T11:56:00+08:00
description: sudo yum install protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-develsudo yum install gflags-devel glog-devel lmdb-develsudo yum install openblas-develinstall caffedonwload and checkoutgit clone https://github.com/intel/caffe.git cd caffe && git checkout 1.0.6modify caffe sourcemove PATCH/caffe.patch, PATCH/clip.patch to caffe folderrun git apply caffe.patch to modify caffeinstall caffe and pycaffemkdir build && cd build && cmake -DCPU_ONLY=1 -DCMAKE_BUILD_TYPE=Release ..mkdir build && cd build && cmake -DCPU_ONLY=1 -DUSE_MLSL=0 -DCMAKE_BUILD_TYPE=Release ..make all -j$(nproc)set caffe and pycaffe envchange user to rootCAFFE_ROOT=$(YOUR CAFFE FOLDER)cd $CAFFE_ROOT and run:for req in $(cat python/requirements.txt) pydot; do pip install $req; done export PYCAFFE_ROOT=$CAFFE_ROOT/python export PYTHONPATH=$PYCAFFE_ROOT:$PYTHONPATH export PATH=$CAFFE_ROOT/build/tools:$PYCAFFE_ROOT:$PATH