欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ImageProjectiveTransform 错误解决办法

程序员文章站 2022-06-09 17:24:35
...

 

tf.train.import_meta_graph  报错

Traceback (most recent call last):
  File "freeze_graph.py", line 109, in <module>
    main(parse_arguments(sys.argv[1:]))
  File "freeze_graph.py", line 50, in main
    saver = tf.train.import_meta_graph(os.path.join(model_dir_exp, meta_file), clear_devices=True)
  File "/root/anaconda3/envs/tsp/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1909, in import_meta_graph
    **kwargs)
  File "/root/anaconda3/envs/tsp/lib/python3.6/site-packages/tensorflow/python/framework/meta_graph.py", line 737, in import_scoped_meta_graph
    producer_op_list=producer_op_list)
  File "/root/anaconda3/envs/tsp/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 432, in new_func
    return func(*args, **kwargs)
  File "/root/anaconda3/envs/tsp/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 431, in import_graph_def
    _RemoveDefaultAttrs(op_dict, producer_op_list, graph_def)
  File "/root/anaconda3/envs/tsp/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 211, in _RemoveDefaultAttrs
    op_def = op_dict[node.op]
KeyError: 'ImageProjectiveTransform'

解决办法: 

import tensorflow.contrib.image

参考:

https://github.com/tensorflow/tensorflow/issues/19774