ARM-software / ComputeLibrary

The Compute Library is a set of computer vision and machine learning functions optimised for both Arm CPUs and GPUs using SIMD technologies.
MIT License
2.83k stars 775 forks source link

Extracting weights for ACL from tensorflow pre-trained MobilenetV2 SSDlite frozen graph #617

Closed krgor closed 5 years ago

krgor commented 5 years ago

Hi,

ACL version: v 18.11 Platform: Android-7.1

Currently I am trying to implement the Mobilenet V2 SSDlite detection model on ACL 18.11. I am using graph APIs to create a graph.

I am using the frozen graph from tensorflow from here. I modified the tensorflow_data_extractor.py provided in ACL to extract the weights from the frozen graph.

The modified script is attached. tensorflow_data_extractor_ssdlite.py.zip

However the graph's output doesn't seem to be expected and seems to be having issue with weight extrating.

Let me know if you need more details on the problem.

Can you please review the script and help me to extract the weights correctly from the tensorflow frozen model?

Thanks, KGor

ManubARM commented 5 years ago

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 ssdlite_mobilenet_v2_coco_2018_05_09/frozen_inference_graph.pb -d output

I am assuming the directory ssdlite_mobilenet_v2_coco_2018_05_09 is in scripts too.

Thanks, Manuel

krgor commented 5 years ago

@ManubARM Thanks a lot for sharing the script. It's working :). I am closing the ticket. Regards, KGor