Skip to content

Instantly share code, notes, and snippets.

@rjpower
Last active December 12, 2018 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjpower/03372a50908a5722684af62a2707bb78 to your computer and use it in GitHub Desktop.
Save rjpower/03372a50908a5722684af62a2707bb78 to your computer and use it in GitHub Desktop.
disable grappler
from tensorflow.core.protobuf import rewriter_config_pb2
config = tf.ConfigProto()
config.graph_options.rewrite_options.memory_optimization = (
rewriter_config_pb2.RewriterConfig.NO_MEM_OPT)
off = rewriter_config_pb2.RewriterConfig.OFF
config.graph_options.rewrite_options.layout_optimizer = off
config.graph_options.rewrite_options.constant_folding = off
config.graph_options.rewrite_options.arithmetic_optimization = off
config.graph_options.rewrite_options.dependency_optimization = off
config.graph_options.rewrite_options.loop_optimization = off
config.graph_options.rewrite_options.function_optimization = off
...
session_config=config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment