Problem in reorg layer #49
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Using this network configuration the output of reorg layer using CUDNN and TensorRT is different from the exported outputs of darknet using CPU:
I have checked the code and noticed that it is the exact code in the darknet project for reorg layer on GPU. Could it be a bug in darknet code? Or there is something I am missing?
It should be noted that I have tested the provided network in darknet using both CPU and GPU many times and the final results are similar. But I have not compared all the elements of the output of reorg layer between CPU and GPU as in tkDNN.
P.S. I used my fork of this repo which is mentioned in #47.
Are you sure the error is in the reorg?
If you end the network right before the reorg the result is correct? And right after?
Are the input and output dimensions of reorg the same as darknet?
I used the debug folder and checked the output of all the layers. Everything is correct until the reorg layer.
This output is similar to darknet so the dimensions must be correct:
I found the problem.
Input arguments of the
reorg_kernel()are output dimensions of the result. Therefore the arguments ofreorgForward()are incorrect and should be changed like this:Similarly
ReorgRT::configure()needs to be changed:Pull request #47, now contains this fix.
Reorg Is a layer of the old version of YOLOs, in that time I was referring to the original darknet implementation, not the Alexey one.
In the original reorg layer it uses the input dimensions:
https://github.com/pjreddie/darknet/blob/master/src/reorg_layer.c
This layer in the Alexey impl is called reorg_old_layer:
https://github.com/AlexeyAB/darknet/blob/master/src/reorg_old_layer.c
I have to check if this layer modification works even for the old YOLOs and then I will approve your changes.
Anyway thank you, I was missing this layer switch.
You are right. I didn't noticed this. Actually my configuration contains a
reorg3dlayer. I addedreorg3djust as an alias for thereorglayer. Therefore the problem occurred. My fix will definitely affect older YOLO versions. May be add a separatereorg3dlayer like Alexey?Or we can add an option to the reorg, since the code is pretty much the same
Ok. I did the fix.