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

Tiny v3 (maybe full) performance is not desirable. Perhaps the problem lies in the upsampling layer. #77

Open
LordkTk opened this issue May 24, 2019 · 1 comment

Comments

@LordkTk
Copy link

LordkTk commented May 24, 2019

I build tiny model from scratch thanks to the author's code. However, its prediction is sometimes bad. I checked the code several times but couldn't find anything wrong.
Many people seem to have the same problem: #47; #46; #28;
even the full v3 seems to have similar problem: #40; maiminh1996/YOLOv3-tensorflow#21 (from another repo but similar implementation of yolo)
After debugging, I find that the results obtained from the first feature map (i.e. 13x13) are always good, as shown below.
image
But the results predicted by the second feature map (26x26) are always bad, as shown below.
image
The combined results are
image
The only difference between the first and second feature map is that the second is obtained using the upsampling option. And the author has mentioned this in https://itnext.io/implementing-yolo-v3-in-tensorflow-tf-slim-c3c55ff59dbe and choosed nearest neighbor for upsampling. Other authors i could find also use it. But the results turn out to be imperfect.
I searched for a long time and found resize option in tensorflow have some bugs :tensorflow/tensorflow#6720; https://hackernoon.com/how-tensorflows-tf-image-resize-stole-60-days-of-my-life-aba5eb093f35. So i replace the tf option of upsampling with resize in cv2 and even rescale in skimage. I also try tf.image.resize_bilinear which is used in Pytorch (https://blog.paperspace.com/how-to-implement-a-yolo-v3-object-detector-from-scratch-in-pytorch-part-2/). All these barely improve the results.
Maybe it's better to train it from scratch. But i really want to know what is wrong with the code. Is it the upsampling cause such bad prediction? Hope some one can give an answer.

@LordkTk LordkTk changed the title Tiny (maybe full) performance is not desirable. Perhaps the problem lies in the upsampling layer. Tiny v3 (maybe full) performance is not desirable. Perhaps the problem lies in the upsampling layer. May 24, 2019
@lucy3589
Copy link

lucy3589 commented Jul 9, 2019

I build tiny model from scratch thanks to the author's code. However, its prediction is sometimes bad. I checked the code several times but couldn't find anything wrong.
Many people seem to have the same problem: #47; #46; #28;
even the full v3 seems to have similar problem: #40; maiminh1996/YOLOv3-tensorflow#21 (from another repo but similar implementation of yolo)
After debugging, I find that the results obtained from the first feature map (i.e. 13x13) are always good, as shown below.
image
But the results predicted by the second feature map (26x26) are always bad, as shown below.
image
The combined results are
image
The only difference between the first and second feature map is that the second is obtained using the upsampling option. And the author has mentioned this in https://itnext.io/implementing-yolo-v3-in-tensorflow-tf-slim-c3c55ff59dbe and choosed nearest neighbor for upsampling. Other authors i could find also use it. But the results turn out to be imperfect.
I searched for a long time and found resize option in tensorflow have some bugs :tensorflow/tensorflow#6720; https://hackernoon.com/how-tensorflows-tf-image-resize-stole-60-days-of-my-life-aba5eb093f35. So i replace the tf option of upsampling with resize in cv2 and even rescale in skimage. I also try tf.image.resize_bilinear which is used in Pytorch (https://blog.paperspace.com/how-to-implement-a-yolo-v3-object-detector-from-scratch-in-pytorch-part-2/). All these barely improve the results.
Maybe it's better to train it from scratch. But i really want to know what is wrong with the code. Is it the upsampling cause such bad prediction? Hope some one can give an answer.

hello , how do you edit cv2.resize(). I edit it ,but it has bug.

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

2 participants