Skip to content

Commit 6ca8378

Browse files
committed
Create config script outputs C++ format vector
1 parent 269f0c6 commit 6ca8378

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/load_model/create_config_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def create_serialized_options(fraction, growth):
44
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=fraction, allow_growth=growth)
55
config = tf.ConfigProto(gpu_options=gpu_options)
66
serialized = config.SerializeToString()
7-
return list(map(hex, serialized))
7+
return '{' + ','.join(list(map(hex, serialized))) + '}'
88

99
if __name__ == "__main__":
1010
print("Create serialized options which allow TF to use a certain percentage of GPU memory and allow TF to expand this memory if required.")

examples/load_model/create_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def example_1():
1313
i = tf.initializers.global_variables()
1414

1515
# Write the model definition
16-
with open('models/load_model.pb', 'wb') as f:
16+
with open('load_model.pb', 'wb') as f:
1717
f.write(tf.get_default_graph().as_graph_def().SerializeToString())
1818

1919

0 commit comments

Comments
 (0)