繁体   English   中英

Tensorflow 1.15 没有加载冻结图,过去一周给了我同样的错误

[英]Tensorflow 1.15 is not loading frozen graph, and has given me the same error for the past week

好的,所以我正在 Google Colab 的一个大型项目中工作,我必须从所有其他项目中检测到某个 object。

现在,在过去一周的大部分时间里,我一直在不知疲倦地工作试图让图表加载,但是我的天哪.... 似乎没有任何工作。

所以,我遇到问题的代码块是:

detection_graph = tf.Graph()
with detection_graph.as_default():
  od_graph_def = tf.GraphDef()
  with tf.gfile.GFile(PATH_TO_FROZEN_GRAPH, 'rb') as fid:
    serialized_graph = fid.read()
    od_graph_def.ParseFromString(serialized_graph)
    tf.import_graph_def(od_graph_def, name='')

错误出现在最后一行。 出于某种原因,它说: NotFoundError: Op type not registered 'TFLite_Detection_PostProcess' in binary running on e32766609f28. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (eg) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed. NotFoundError: Op type not registered 'TFLite_Detection_PostProcess' in binary running on e32766609f28. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (eg) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.

另外,我只想补充一点 PATH_TO_FROZEN_GRAPH 是: /content/ssd_mobilenet_v3_small_coco_2020_01_14/frozen_inference_graph.pb 我也可以在那里看到文件。 所以,我不知道问题是什么。

有什么解决办法吗? 谢谢!

TFLite_Detection_PostProcess 默认包含在较新的 TFLite 版本(如 2.3.0 或 2.4.0)中。 你能试试那个版本吗?

否则,您必须将其添加到 TFLite 解释器。 执行此操作的方法取决于您使用的语言。 请参阅https://www.tensorflow.org/lite/guide/ops_custom#register_the_operator_with_the_kernel_library

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM