UnFlow icon indicating copy to clipboard operation
UnFlow copied to clipboard

KeyError: "correlation"

Open David3310273 opened this issue 5 years ago • 1 comments

Hello, I want to get the output flow images from your CSS_ft model, the code I wrote is showing below:

import tensorflow as tf
import os

ckpt_path = "~/UnFlow/logs/CSS_ft"

with tf.Session() as sess:
    saver = tf.train.import_meta_graph(os.path.join(ckpt_path, "model.ckpt.meta"))
    saver.restore(sess, tf.train.latest_checkpoint(ckpt_path))
    print("finished!")

when I execute the code, it shows the error like this:

Traceback (most recent call last):
  File "export_endovis.py", line 8, in <module>
    saver = tf.train.import_meta_graph(os.path.join(ckpt_path, "model.ckpt.meta"))
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1435, in import_meta_graph
    meta_graph_or_file, clear_devices, import_scope, **kwargs)[0]
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1457, in _import_meta_graph_with_return_elements
    **kwargs))
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/meta_graph.py", line 806, in import_scoped_meta_graph_with_return_elements
    return_elements=return_elements)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/importer.py", line 399, in import_graph_def
    _RemoveDefaultAttrs(op_dict, producer_op_list, graph_def)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/importer.py", line 159, in _RemoveDefaultAttrs
    op_def = op_dict[node.op]
KeyError: 'Correlation'

please help me out, thanks!

David3310273 avatar Dec 23 '19 09:12 David3310273

It looks like the Correlation op was not compiled. Did you run the run.py script? This is needed for some initialization, including op compilation. Note that you may need to use an old version of tensorflow for compilation to work.

simonmeister avatar Feb 17 '20 16:02 simonmeister