Skip to content

Python script to chop apart existing keras models and gen a new model with arbitrary inputs and outputs.

Notifications You must be signed in to change notification settings

thepaulm/keras_graph_chopper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Keras Graph Chopper

Python script to chop apart existing keras models and gen a new model with arbitrary inputs and outputs.

Sometimes you have a big keras graph model and you want to chop it apart into a subgraph with new inputs and outputs. This script does that for you.

Some example usage:

./keras_graph_chopper.py --source-model=~/models/original_model.h5 \
			--dest-model=~/models/new_model.h5 \
			--input-names=post_precessing,first_input,injected_feature \
			--output-names=intermiate_layer,original_output

This script will generate new inputs, resolve all layer dependencies, build new subgraph, and save it.

Issue reports and PRs welcome.

About

Python script to chop apart existing keras models and gen a new model with arbitrary inputs and outputs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages