WongKinYiu / CrossStagePartialNetworks

Cross Stage Partial Networks
https://github.com/WongKinYiu/CrossStagePartialNetworks
894 stars 172 forks source link

Did you compare AP and FPS (rather than BFLOPS) of models ? #1

Open AlexeyAB opened 4 years ago

AlexeyAB commented 4 years ago

@WongKinYiu Hi,

Did you compare AP (MS COCO) and 1080ti fps (rather than BFLOPS) of models ?

With the same: network resolution, mini_batch=batch/subdivisions, data augmentation, the same dataset - to compare apples with apples.

AlexeyAB commented 4 years ago

I found: https://arxiv.org/abs/1911.11929v1

But did you try backbones CSPDarkNet-53-SPP and CSPDarkNet-53-Elastic for Yolov3-spp / PAN?

image

WongKinYiu commented 4 years ago

@AlexeyAB Hello,

Yes, we do comparison of AP, fps, BFLOPs, #parameters. image

For big models, due to I have only few GPUs. Training one model need about one and half month. So currently we only have results of CSPResNeXt50-PANet-SPP and CSPResNeXt50-PANet-SPP-GIoU. If you would like to test the speed of other models, I could upload the cfg files.

WongKinYiu commented 4 years ago
  • CSPResNeXt50-PANet-SPP-GIoU - 35 FPS (+5 FPS) - 60.6 mAP@0.5 - 38.4 mAP@0.5...0.95 (+2.2)

This result is for CSPResNeXt50-PANet-SPP, not CSPResNeXt50-PANet-SPP-GIoU. We focus on AP50, so in our paper, we do not use GIoU. image

WongKinYiu commented 4 years ago

@AlexeyAB Hello,

I upload the cfg files to in progress. Please fell free to try them.

AlexeyAB commented 4 years ago

@WongKinYiu Thanks!

Will you release cfg/weights files for these models?

image

WongKinYiu commented 4 years ago

@AlexeyAB Hmm...

Due to the non-disclosure agreement, I can not release the backbones of lightweight models currently. If you are interested in the EFM(SAM) or PRN, I can share you the head cfg of these models. Well...next month I will try to discuss with the company whether I can release some models or not.

Code-Fight commented 4 years ago

Hi @WongKinYiu

Now it ’s "Next Month".

LOL

Waiting for you share.

WongKinYiu commented 4 years ago

@Code-Fight Tomorrow i ll discuss with them.

Code-Fight commented 4 years ago

@WongKinYiu Great Looking forword your good news.

WongKinYiu commented 4 years ago

falid :sob: :sob: :sob:

Code-Fight commented 4 years ago

oh....too sad, but thanks for your best

dreambit commented 4 years ago

@WongKinYiu Hi

I would like to test csresnet50-elastic-panet-spp.cfg, csresnext50-yolo-spp.cfg, csresnext50-panet-spp.cfg, csresnext50-panet-spp-giou.cfg on gtx1080ti

What should i change in config files for classes = 2 and width=640 height=384

Is it enough to: 1) change line classes=80 to 2 in each of 3 [yolo]-layers 2) change [filters=255] to filters=(2+ 5)x3 in the 3 [convolutional] before each [yolo] layer as in @AlexeyAB documentation?

Is it possible to use darknet53.conv.74 as initial weight? Or train from scratch?

Thank you.

WongKinYiu commented 4 years ago

@dreambit hello,

plz use the pretrained weights from https://github.com/WongKinYiu/CrossStagePartialNetworks#big-models

and follow the https://github.com/AlexeyAB/darknet#how-to-train-tiny-yolo-to-detect-your-custom-objects to get initial weights like csresnext50.conv.80 and so on.

dreambit commented 4 years ago

@WongKinYiu Thanks, what about changes in config files with different classes and network size? are there any changes that have to be made except those mentioned in @AlexeyAB docs?

WongKinYiu commented 4 years ago

@dreambit

change line classes=80 to 2 in each of 3 [yolo]-layers change [filters=255] to filters=(2+ 5)x3 in the 3 [convolutional] before each [yolo] layer as in @AlexeyAB documentation?

it is enough.

dreambit commented 4 years ago

@WongKinYiu Hello

I have almost completed training csresnext50-panet-spp-giou.cfg. Could u provide (if you have one) elastic version of csresnext50-panet-spp[-giou], so i can test it.

Thank you.

WongKinYiu commented 4 years ago

@dreambit

https://github.com/WongKinYiu/CrossStagePartialNetworks/blob/master/in%20progress/csresnext50-elastic-panet-spp.cfg here u r.

dreambit commented 4 years ago

@WongKinYiu, appreciate it 👍

dreambit commented 4 years ago

@WongKinYiu I've changed network size to 640x385, and classes = 2 filters = 21(in each conv. layer before yolo), random = 0

Bug i have 0 mAP.

What is wrong?

image

Thanks.

AlexeyAB commented 4 years ago

@dreambit

Use pre-trained weights.

Set 608x384

https://github.com/AlexeyAB/darknet#how-to-improve-object-detection

increase network resolution in your .cfg-file (height=608, width=608 or any value multiple of 32) - it will increase precision

dreambit commented 4 years ago

@AlexeyAB

It was a typo, size is 640x384

@WongKinYiu @AlexeyAB I used wrong initial weights, now it is ok.

WongKinYiu commented 4 years ago

@dreambit great!

cmtsai commented 4 years ago

I have changed network size to 608x608, classes = 40, and filters = 135 (in each conv. layer before yolo), random = 1. I have used csresnext50-panet-spp.cfg and csresnext50c.conv.80 to train my own data set. However, current avg loss = -nan and 0 mAP. What is the problem?

chart

WongKinYiu commented 4 years ago

@cmtsai Hello,

csresnext50-panet-spp.cfg should use csresnext50.conv.80 as pre-trained model, not csresnext50c.conv.80.

cmtsai commented 4 years ago

@WongKinYiu Hello, 3Q very much for your response! How to obtain csresnext50.conv.80?

cmtsai commented 4 years ago

@WongKinYiu Hi, I got it! 3Q very much!

AlexeyAB commented 4 years ago

@WongKinYiu Hi,

Did you try to use Maxout for CSP?

I.e. after route use maxpool_depth:

[route]
layers = 36, 21

[maxpool]
maxpool_depth=1
out_channels=256
stride=1
size=1

image

WongKinYiu commented 4 years ago

@AlexeyAB

Hello, I used maxout in small model. and I applied maxpool_depth before route.

AlexeyAB commented 4 years ago

@WongKinYiu Hi,

Why did you add CenterNet resnet-102 instead of CenterNet dla-34 to your comparison table?

WongKinYiu commented 4 years ago

@AlexeyAB

Hello, we test CenterNet dla-34 on 1080ti, but it can not reach > 30 fps. In my test, CenterNet resnet-102 run faster than CenterNet dla-34 almost twice times. So I only compare with CenterNet resnet-102.

There are also many issues of inference speed of dla on CenterNet's github. I have not found solution to solve the inference time problem. If you face the problem and solve it, please tell me how to deal with it.

AlexeyAB commented 4 years ago

@WongKinYiu

So their results aren't reproducible on 1080 Ti (GP102-350-K1-A1) which is the mostly the same as their Titan Xp (GP102-450-A1)

https://arxiv.org/pdf/1904.07850v2.pdf

i7-8086K CPU, Titan Xp GPU, Pytorch 0.4.1, CUDA 9.0, and CUDNN 7.1.

WongKinYiu commented 4 years ago

@AlexeyAB

I only check FPS. I do not open an issue, however, in their discussion:

AlexeyAB commented 4 years ago

@WongKinYiu Typo in chart.

Initially theses 2 models was for 416x416 (53 FPS) and 512x512 (44 FPS) but 2 new models are for 512x512 (44 FPS) and 608x608 (35 FPS): image

WongKinYiu commented 4 years ago

@AlexeyAB Oh!

Thanks for reminder, i will correct the figure soon.

WongKinYiu commented 4 years ago

@AlexeyAB

image

reactivetype commented 4 years ago

If you are interested in the EFM(SAM), I can share you the head cfg of these models.

@WongKinYiu would you please share the part of cfg for EFM head. I would like to compare it with PRN and PANet

WongKinYiu commented 4 years ago

sure, will share the cfg for efm head few hours later.

WongKinYiu commented 4 years ago
##########################

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[shortcut]
activation=leaky
from=-2

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

# pyramid
[route]
layers= #26x26

[maxpool]
maxpool_depth=1
out_channels=128
stride=1
size=1

[route]
layers=-1,-3

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[shortcut]
activation=leaky
from=-2

[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky

# pyramid
[route]
layers= #52x52

[maxpool]
maxpool_depth=1
out_channels=64
stride=1
size=1

[convolutional]
batch_normalize=1
filters=64
size=3
stride=2
pad=1
activation=leaky

[route]
layers=-1,-4

[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[shortcut]
activation=leaky
from=-2

[convolutional]
batch_normalize=1
filters=32
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

# pyramid
[route]
layers= #52x52

[maxpool]
maxpool_depth=1
out_channels=32
stride=1
size=1

[route]
layers=-1,-3

[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[shortcut]
activation=leaky
from=-2

[convolutional]
batch_normalize=1
filters=32
size=1
stride=1
pad=1
activation=leaky

# pyramid
[route]
layers= #104x104

[maxpool]
maxpool_depth=1
out_channels=32
stride=1
size=1

[convolutional]
batch_normalize=1
size=3
stride=2
pad=1
filters=32
activation=leaky

[route]
layers=-1,-4

##########################
ekko-1996 commented 4 years ago
##########################

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[shortcut]
activation=leaky
from=-2

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

# pyramid
[route]
layers= #26x26

[maxpool]
maxpool_depth=1
out_channels=128
stride=1
size=1

[route]
layers=-1,-3

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[shortcut]
activation=leaky
from=-2

[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky

# pyramid
[route]
layers= #52x52

[maxpool]
maxpool_depth=1
out_channels=64
stride=1
size=1

[convolutional]
batch_normalize=1
filters=64
size=3
stride=2
pad=1
activation=leaky

[route]
layers=-1,-4

[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[shortcut]
activation=leaky
from=-2

[convolutional]
batch_normalize=1
filters=32
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

# pyramid
[route]
layers= #52x52

[maxpool]
maxpool_depth=1
out_channels=32
stride=1
size=1

[route]
layers=-1,-3

[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[shortcut]
activation=leaky
from=-2

[convolutional]
batch_normalize=1
filters=32
size=1
stride=1
pad=1
activation=leaky

# pyramid
[route]
layers= #104x104

[maxpool]
maxpool_depth=1
out_channels=32
stride=1
size=1

[convolutional]
batch_normalize=1
size=3
stride=2
pad=1
filters=32
activation=leaky

[route]
layers=-1,-4

##########################

@WongKinYiu HI,I cant understand the cfg of EFM,I think it is different from the structure in the paper