ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

Extracting data from pre-trained tensorflow model

Open ghost opened this issue 9 years ago • 7 comments

Hello,

I'm trying to extract data and print the names and shapes of each layer. I am not sure I have this correctly.

root@:~/test/ssd_mobilenet_v1_coco_2017_11_17# python /home/root/ComputeLibraryNEON/scripts/tensorflow_data_extractor.py -m model.ckpt -n model.ckpt.meta
Model restored.

Where the *.npy files are generated? Are they saved into ComputeLibraryNEON/data/fixed_point/ folder?

My model folder is

-rw-r--r-- 1 root root       77 Nov 18  2017 checkpoint
-rw-r--r-- 1 root root 29112121 Nov 18  2017 frozen_inference_graph.pb
-rw-r--r-- 1 root root 27380740 Nov 18  2017 model.ckpt.data-00000-of-00001
-rw-r--r-- 1 root root     8937 Nov 18  2017 model.ckpt.index
-rw-r--r-- 1 root root  3038417 Nov 18  2017 model.ckpt.meta

Thank you.

ghost avatar Nov 23 '17 15:11 ghost

Hello @peter73421,

When you run the script it should produce the files in the folder that you run it from.

GeorgeARM avatar Dec 01 '17 17:12 GeorgeARM

per doc if the script runs successfully, it should print the names and shapes of each parameter and generates .npy files... I see

root:~/test/ssd_mobilenet_v1_coco_2017_11_17# python /home/root/test/ComputeLibrary/scripts/tensorflow_data_extractor.py -m model.ckpt -n model.ckpt.meta
Model restored.

no print of names/shapes, and no *npy files

ghost avatar Dec 02 '17 16:12 ghost

i also encounter the same problem.

hexiangquan avatar Jan 06 '18 02:01 hexiangquan

It could be the tf.GraphKeys problem as mentioned in the tensorflow_data_extractor.py, try GLOBAL_VARIABLES instead of TRAINABLE_VARIABLES.

zhaofenqiang avatar Feb 08 '18 03:02 zhaofenqiang

Could it be related to #324 ?

AnthonyBarbier avatar Feb 13 '18 15:02 AnthonyBarbier

I also encounter the same problem.

WenguoLi avatar Apr 02 '18 11:04 WenguoLi

Could you try with our script in the development repo? git clone https://review.mlplatform.org/ml/ComputeLibrary

The script is called in the directory scripts and you can call it in this way: python tf_frozen_model_extractor.py -m ssd_mobilenet_v1_coco_2017_11_17/frozen_inference_graph.pb -d output

I am assuming the directory ssd_mobilenet_v1_coco_2017_11_17 is in scripts too.

Thanks, Manuel

PS: There is a similar issue with an updated version of the network. https://github.com/ARM-software/ComputeLibrary/issues/617

ManubARM avatar Feb 12 '19 17:02 ManubARM