diff options
author | steniu01 <steven.niu@arm.com> | 2017-06-21 16:45:41 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-09-17 14:14:20 +0100 |
commit | bee466b5eac4ec39d4032d946c9a4aee051f2b31 (patch) | |
tree | 264e5124e7d2e1ccb3277b0ef478f0bb4a145a0a /docs/03_scripts.dox | |
parent | 8af2dd6eb230f2205070dce50c2a22bdf2d55e46 (diff) | |
download | ComputeLibrary-bee466b5eac4ec39d4032d946c9a4aee051f2b31.tar.gz |
COMPID-345 Add caffe_data_extractor.py script and the instructions
Change-Id: Ibb84b2060c4d6362be9ce4b1757e273e013de618
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/78630
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'docs/03_scripts.dox')
-rw-r--r-- | docs/03_scripts.dox | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/docs/03_scripts.dox b/docs/03_scripts.dox new file mode 100644 index 0000000000..a91a93166b --- /dev/null +++ b/docs/03_scripts.dox @@ -0,0 +1,40 @@ +/** +@page data_import Importing data from existing models + +@tableofcontents + +@section caffe_data_extractor Extract data from pre-trained caffe model + +One can find caffe <a href="https://github.com/BVLC/caffe/wiki/Model-Zoo">pre-trained models</a> on +caffe's official github repository. + +The caffe_data_extractor.py provided in the @ref scripts folder is an example script that shows how to +extract the hyperparameter values from a trained model. + +@note complex networks might require alter the script to properly work. + +@subsection how_to How to use the script + +Install caffe following <a href="http://caffe.berkeleyvision.org/installation.html">caffe's document</a>. +Make sure the pycaffe has been added into the PYTHONPATH. + +Download the pre-trained caffe model. + +Run the caffe_data_extractor.py script by + + ./caffe_data_extractor.py -m <caffe model> -n <caffe netlist> + +For example, to extract the data from pre-trained caffe Alex model to binary file: + + ./caffe_data_extractor.py -m /path/to/bvlc_alexnet.caffemodel -n /path/to/caffe/models/bvlc_alexnet/deploy.prototxt + +The script has been tested under Python2.7. + +@subsection result What is the expected ouput from the script + +If the script run succesfully, it prints the shapes of each layer onto the standard +output and generates *.dat files containing the weights and biases of each layer. + +The @ref arm_compute::utils::load_trained_data shows how one could load +the weights and biases into tensor from the .dat file by the help of Accessor. +*/ |