Saturday, March 16, 2019

Some notes on Caffe

  1. To deploy a model to run feeding a single input file, use the following:

    cd caffe ./build/examples/cpp_classification/classification.bin path/to/deploy.prototxt path/to/caffemodel path/to/mean.binaryproto path/to/labels.txt path/to/image.jpg

    https://groups.google.com/forum/#!topic/caffe-users/zMVHKdX1vj8 
  2. Difference between caffe.Net and caffe.classifier'
    https://github.com/BVLC/caffe/blob/master/python/caffe/classifier.py
    (commit id = 0050c20)
  3. Deploy
    https://github.com/BVLC/caffe/wiki/Using-a-Trained-Network:-Deploy

  4. In docker's caffe, importing pyplot causes an error, demanding python-tk package's install.
    This is due to that pyplot's backend is prepared for interactive mode and can be circumvented by executing matplotlib.use('Agg').
    https://matplotlib.org/faq/howto_faq.html

    Note that it seems that 'import caffe' implicitly imports
  5. We can feed input data in an array format directly to Caffe's network.
    http://christopher5106.github.io/deep/learning/2015/09/04/Deep-learning-tutorial-on-Caffe-Technology.html

  6. There is a log parser inside Caffe
    https://stackoverflow.com/questions/31978186/monitor-training-validation-process-in-caffe

  7. The order of "mean" parameters are BGR for reference_Caffe_model; The following answer 
    https://groups.google.com/forum/#!topic/caffe-users/9opH6AW3Irw

  8. To feed data to caffe's network, apart from db files such as lmdb or hdf5, one can use normal image format files by reading them via "ImageData" layer.
  9. To copy weights from layer to layer, just simply copy its blob data, a technique called "Net Surgery"(https://github.com/BVLC/caffe/blob/master/examples/net_surgery.ipynb).
    https://stackoverflow.com/questions/46420040/can-you-copy-the-weights-from-just-the-first-3-layers-of-a-network-not-exactly
  10. https://github.com/BVLC/caffe/issues/2152
  • "Blob is more general, and the real currency for data in Caffe, so life could be simpler with Blob alone."
  • "A Blob<uint8> could be used for storing data at lower precision then casting to Blob<float> for computation. This takes care of the use case of Datum for int / less-than-float precision data storage."
  • "The one responsibility of Datum that is distinct from Blob is holding encoded image data. For this purpose, the current Datum dimensions and implementation are fine."(https://github.com/BVLC/caffe/issues/2152)


    1. d

    No comments:

    Post a Comment

    Writing a post in Markdown in Blogger

    Following articles are helpful. * [【令和最新版】Blogger で Markdown を用いて記事を書く方法](https://qiita.com/hoge_fu-ga/items/267ea5ad4f8c120eaeb8) * [Bl...