how to predict with .meta and checkpoint files in tensorflow?

前端 未结 2 1744
南笙
南笙 2020-12-15 14:52

I\'m learning about MobileNet thesedays and i\'m new to tensorflow. After training with ssd-mobilenet model,i got checkpoint file , .meta file , graph.pbtxt file and so on.

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-15 15:22

    Just for those who have the problem like wu ruize and CoupDeMistral:

    But I got this error: "The name 'image_tensor:0' refers to a Tensor which does not exist. The operation, 'image_tensor', does not exist in the graph."

    You need to name your tensor first before using detection_graph.get_tensor_by_name.

    For example, something like this:

    accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32),name='accuracy')
    

    Notice that the tensor above has been named as 'accuracy'.

    After that you can enjoy the restore operation by:

    detection_graph.get_tensor_by_name('accuracy:0')
    

    Have fun now :P!

提交回复
热议问题