Skip to content

Commit 8e22749

Browse files
Fix bug in reading hash tables in freeze_session (#1709)
Signed-off-by: Tom Wildenhain <[email protected]>
1 parent 47acb8a commit 8e22749

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tf2onnx/tf_loader.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,10 @@ def freeze_session(sess, input_names=None, output_names=None, get_tables=False):
308308
initialized_tables = {}
309309
tf.tables_initializer().run(session=sess)
310310
for info in table_info:
311+
if info.shared_name is None:
312+
continue
311313
h = lookup_ops.hash_table_v2(info.key_dtype, info.val_dtype, shared_name=info.shared_name)
314+
n = info.shared_name
312315
try:
313316
k, v = lookup_ops.lookup_table_export_v2(h, info.key_dtype, info.val_dtype)
314317
k, v = sess.run([k, v])

0 commit comments

Comments
 (0)