Coder Social home page Coder Social logo

cuuupid / tensorflow-export-utils Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 19 KB

Python Utils for exporting, freezing, and pbtxt generation with Tensorflow. (No Bazel)

Python 100.00%
tensorflow bazel graph freezing pbtxt pretrained-checkpoints utility

tensorflow-export-utils's Introduction

Freezing Models

Preparation

Download the checkpoint files to ckpt folder here. (Use the MobilenetV1 224 pretrained checkpoint from here)

Export the inference graph:

python export_inference_graph.py \
    --alsologtostderr --model_name=mobilenet_v1 \
    --image_size=224 --output_file=mobilenet.pb

Freeze the graph:

python freeze_graph.py --input_graph=mobilenet.pb \
                       --input_checkpoint=ckpt/mobilenet_v1_1.0_224.ckpt \
                       --output_graph=mobilenet_f.pb --input_binary=true \
                       --output_node_names=MobilenetV1/Predictions/Reshape_1

Edit pb_to_pbtxt.py to use the name of your PB file as graph. Make pbtxt:

python pb_to_pbtxt.py

Serving

See api.py for example. Change input and output tensor names accordingly.

Credits

Got the export and freezing scripts from tensorflow. Basically moving the utilities out of the repo to allow them to be used without bazel.

Models from tensorflow/models repo.

Datasets, pretrained checkpoints, etc. from tensorflow/models/research/slim.

Working as of 3/4/2018.

tensorflow-export-utils's People

Contributors

cuuupid avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

urbanguac ailib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.