fidler-lab / polyrnn-pp

Inference Code for Polygon-RNN++ (CVPR 2018)
GNU General Public License v3.0
735 stars 161 forks source link

ValueError: graph_def is invalid at node u'GatherTree': Input types mismatch #19

Closed Kongsea closed 6 years ago

Kongsea commented 6 years ago

When I restore the PolygonRNN++ model, it raised the following error:

INFO:tensorflow:Building PolygonRNN++ ...
Traceback (most recent call last):
  File "src/inference.py", line 135, in <module>
    tf.app.run(inference)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 124, in run
    _sys.exit(main(argv))
  File "src/inference.py", line 79, in inference
    model = PolygonModel(FLAGS.PolyRNN_metagraph, polyGraph)
  File "/home/konghaiyang/polygon/polyrnn-pp/src/PolygonModel.py", line 43, in __init__
    self._restore_graph(meta_graph_path)
  File "/home/konghaiyang/polygon/polyrnn-pp/src/PolygonModel.py", line 47, in _restore_graph
    self.saver = tf.train.import_meta_graph(meta_graph_path, clear_devices=True)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1838, in import_meta_graph
    **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/meta_graph.py", line 660, in import_scoped_meta_graph
    producer_op_list=producer_op_list)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/deprecation.py", line 316, in new_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/importer.py", line 657, in import_graph_def
    ', '.join(x.name for x in op._input_dtypes))))
ValueError: graph_def is invalid at node u'GatherTree': Input types mismatch (expected 'int32, int32, int32, int32' but got 'int32, int32, int32').

Could anybody tell me what's the reason and how to fix it? Thank you.

Kongsea commented 6 years ago

It's because I'm using tensorflow 1.5. I should switch it to 1.3.0.