Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Someone explain the sess.run in yolo.py? #24

Open
doubleLLL3 opened this issue Aug 29, 2020 · 1 comment
Open

Someone explain the sess.run in yolo.py? #24

doubleLLL3 opened this issue Aug 29, 2020 · 1 comment

Comments

@doubleLLL3
Copy link

I don't really understand the [self.boxes, self.scores, self.classes] in self.generate().
My purpose is to use yolo4.pb to do some prediction just in tensorflow, but here [self.boxes, self.scores, self.classes] do some tricks in keras and I don't know how to do this exchange using yolo4.pb.

out_boxes, out_scores, out_classes = self.sess.run(
            [self.boxes, self.scores, self.classes],
            feed_dict={
                self.yolo_model.input: image_data,
                self.input_image_shape: [image.size[1], image.size[0]]
                # K.learning_phase(): 0
            })

Thanks for the coming help!

I use amir-abdi/keras_to_tensorflow convert the yolo4.h5 to yolo4.pb. The format of outputs are different compared to using yolo4.h5.

@doubleLLL3
Copy link
Author

This is what I use to run the pb model, I confirm that the input and output name are correct.

pred_sbbox, pred_mbbox, pred_lbbox = sess.run(
            [return_tensors[1], return_tensors[2], return_tensors[3]],
            feed_dict={return_tensors[0]: image_data})

and one part of pred_sbbox (its shape is (1, 52, 52, 255), 255 is 3 * 85) is like this:
image
It's strange! The 4th column should be the score, but they are all negative, so do the right columns.
Why so many negetive value?
Thanks for the coming help!

One of the correct results I think are like this:
image
This is from yolo3, and pred_sbbox's shape is (1,52,52,3,85)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant