motokimura/yolo_v1_pytorch

full connect

HonestyBrave opened this issue · 6 comments

hi, motokimura,
i have a question about "_make_fc_layers" in "darknet.py", the yolo author is training darknet in Imagenet, the data classes is about 1000, but we are training in voc data set, the classes is about 20, so, the below picture red box wether change to 20?
image

Hi, It should be 1,000.

After pre-trained Darknet on ImageNet (with 1,000 classes), only the convolution layers (layers except for the FC-layer) are passed to YOLO model as you can see in the implementation below.

yolo = YOLOv1(darknet.features)

In YOLO model, a new FC-layer is defined and it has 20 classes.

Hi, It should be 1,000.

After pre-trained Darknet on ImageNet (with 1,000 classes), only the convolution layers (layers except for the FC-layer) are passed to YOLO model as you can see in the implementation below.

yolo = YOLOv1(darknet.features)

In YOLO model, a new FC-layer is defined and it has 20 classes.

Hi, thank you very much,
it's me didn't understand completely, I print the model. features find is only have convolution layers, thank you!

But I confusion, when we training the model in VOC data sets, using the "train_darknet.py", the function of "_make_fc_layers" in "darknet.py" shouldn't change to 20? (because I understand, we training in VOC data sets, not in ImageNet data sets, that only 20 classes, not 1000), it's somewhere I didn't understand? could you give me a more explanation? thank you

train_darknet.py has nothing to with VOC. It should run with ImageNet dataset because Darknet is firstly pre-trained on ImageNet as written in the original YOLO paper.

After pre-trained Darket on ImageNet, its feature extraction part (convolution layers) and YOLO head FC-layer are further fine-tuned on VOC dataset.

Maybe I should have prepared README explaining the procedure but I did not have enough time..

OK, I have understood, thank you very much!