WongKinYiu / ScaledYOLOv4

Scaled-YOLOv4: Scaling Cross Stage Partial Network
GNU General Public License v3.0
2.02k stars 572 forks source link

How many layers from yolov4-csp for partial command? #4

Open LukeAI opened 3 years ago

LukeAI commented 3 years ago

For the purposes of transfer learning, how many layers should I extract from yolov4-csp using the darknet partial command?

ie. ./darknet partial cfg/yolov4-csp.cfg yolov4-csp.weights yolov4-csp.conv.X X

LukeAI commented 3 years ago

If at all possible, it would be really great to get an explanation of how to work this out for any .cfg - I know that you are trying to get the number layers up to the first point at which you change the number of filters on. but some layers don't count? like there are 139 such layers in yolov4 but we only use 137 for the partial? why?

WongKinYiu commented 3 years ago

You can choose:

  1. partial to the latest convolutional layer before SPP.
  2. partial to the (first_yolo_layer - 3) layer.
LukeAI commented 3 years ago

In case anybody else has the same question - I count 148 as being the number of layers to extract for yolov4-csp

toplinuxsir commented 3 years ago

@WongKinYiu W ./darknet partial cfg/yolov4-csp.cfg yolov4-csp.weights yolov4-csp.conv.X X

So what's the exact X for yolov4-csp.cfg ? Thanks!

WongKinYiu commented 3 years ago

https://github.com/WongKinYiu/ScaledYOLOv4/issues/4#issuecomment-729087315

LeoSouquet commented 3 years ago

Hi Guys,

On darknet AlexyAB git hub, he gives the initial weights: https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-csp.conv.142

You can find the source here: https://github.com/AlexeyAB/darknet

And apparently the answer is 142 :)