mystic123 / tensorflow-yolo-v3

Implementation of YOLO v3 object detector in Tensorflow (TF-Slim)
https://medium.com/@pawekapica_31302/implementing-yolo-v3-in-tensorflow-tf-slim-c3c55ff59dbe
Apache License 2.0
893 stars 353 forks source link

What is the output node? #13

Closed linux-devil closed 6 years ago

linux-devil commented 6 years ago

I want to know output node

linux-devil commented 6 years ago

I am trying to generate and free the graph for same operations I need input node and output node. Based on graph visualization on tensorboard seems like input node is Placeholder and output node is concat_1

mystic123 commented 6 years ago

In commit dd09029823f5389282dd575b78d00da5b2fcfae8 I named detections node, so now output node is 'detections'. The input node is the placeholder defined in demo.py

linux-devil commented 6 years ago

I am using latest commit, I made changes to save session using saver.save(sess,export_dir) Further I use save_freeze.py to freeze graph which takes output node as parameter and it fails while running it using "detections" you can find save_freeze.py here : https://github.com/linux-devil/lstm_practice/blob/master/save_freeze.py command : python save_freeze.py --model_dir "/xxxx/yolov3_checkpoint" --output_node_names "detections"

Following is the graph as visualized on tensorboard: graph_large_attrs_key _too_large_attrs limit_attr_size 1024 run 1 There is no node named "detections"

linux-devil commented 6 years ago

Any thoughts?

mystic123 commented 6 years ago

@linux-devil, there should be node named '\<scope>/yolo-v3/detections'. Check this code:


import tensorflow as tf
import numpy as np
from yolo_v3 import yolo_v3, load_weights, detections_boxes

inputs = tf.placeholder(tf.float32, [1, 416, 416, 3])

with tf.variable_scope('detector'):
    detections = yolo_v3(inputs, 80)

t = tf.get_default_graph().get_tensor_by_name('detector/yolo-v3/detections:0')

print(t)
STG284 commented 5 years ago

while running in android using .pb file, I am getting no node "detections" : - java.lang.RuntimeException: Node 'detections' does not exist in model 'file:///android_asset/tiny_graph.pb'

So indeed there is no node detections. What to do?