From bee466b5eac4ec39d4032d946c9a4aee051f2b31 Mon Sep 17 00:00:00 2001 From: steniu01 Date: Wed, 21 Jun 2017 16:45:41 +0100 Subject: 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 Reviewed-by: Georgios Pinitas Reviewed-by: Anthony Barbier --- docs/03_scripts.dox | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 docs/03_scripts.dox (limited to 'docs/03_scripts.dox') 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 pre-trained models 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 caffe's document. +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 -n + +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. +*/ -- cgit v1.2.1