[英]Error Loading Tensorflow Frozen Inference Graph to OpenCV DNN
[英]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.