Will baselines (using tensorflow with gym) allow the exporting of hyperparameters with weight matrix for pretrained models?


#1

I tried to use tensorflow’s freeze_graph.py under the python tools to convert the checkpoint files into a protobuf file for analysis of the weights and the figure out the hyperparameters of the network. However, I wasn’t successful because I was missing files in terms of the input graph.

I found a gist on GitHub (link embedded) that shows how to freeze the model into a protobuf file but when I run the python script with my model folder as the input, it returns some errors as follows (Here’s the command line log):

(tensorflow) Shyamals-iMac:~ shyamalchandra$ python3 freeze_graph.py --model_folder ~/Desktop/models_newest/model-50000/
2017-06-05 23:20:10.561965: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-05 23:20:10.562154: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-05 23:20:10.562185: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-06-05 23:20:10.562191: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-05 23:20:10.562195: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Traceback (most recent call last):
File “freeze_graph.py”, line 54, in
freeze_graph(args.model_folder)
File “freeze_graph.py”, line 40, in freeze_graph
output_node_names.split(",") # The output node names are used to select the usefull nodes
File “/Users/shyamalchandra/Library/Python/3.6/lib/python/site-packages/tensorflow/python/framework/graph_util_impl.py”, line 202, in convert_variables_to_constants
inference_graph = extract_sub_graph(input_graph_def, output_node_names)
File “/Users/shyamalchandra/Library/Python/3.6/lib/python/site-packages/tensorflow/python/framework/graph_util_impl.py”, line 141, in extract_sub_graph
assert d in name_to_node_map, “%s is not in graph” % d
AssertionError: Accuracy/predictions is not in graph

Any ideas if I am on the right track? Also, I found out about freeze graphs from the Tensorflow Extend page within the left pane. Here is the link: https://www.tensorflow.org/extend/tool_developers/