ShuangXieIrene / ssds.pytorch

Repository for Single Shot MultiBox Detector and its variants, implemented with pytorch, python3.
MIT License
571 stars 166 forks source link

Almost results are Zero. #30

Closed kimna4 closed 3 years ago

kimna4 commented 5 years ago

Hello, I tried run your code using "ssd_vgg16_train_voc.yml"

But, almost results are zero and doesn't increase.

======================================================= AP for aeroplane = 0.0000 AP for bicycle = 0.0000 AP for bird = 0.0000 AP for boat = 0.0000 AP for bottle = 0.0000 AP for bus = 0.0000 AP for car = 0.0000 AP for cat = 0.0000 AP for chair = 0.0000 AP for cow = 0.0000 AP for diningtable = 0.0000 AP for dog = 0.0000 AP for horse = 0.0000 AP for motorbike = 0.0000 AP for person = 0.0001 AP for pottedplant = 0.0003 AP for sheep = 0.0000 AP for sofa = 0.0000 AP for train = 0.0000 AP for tvmonitor = 0.0000 Mean AP = 0.0000

Results:
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000

================================================

Above result are printed at epoch 5. Although the number epoch is too low, there are problems. Please tell me the way to fix these problems if you know.

Thank you.

shufanwu commented 5 years ago

I met the same problem and i have trained the model nearly 700 epoch for 300 images with batch size 32

cvtower commented 5 years ago

The same problem met.

anjandeepsahni commented 5 years ago

Any solutions yet for this issue?

kimna4 commented 5 years ago

I use another SSD code (https://github.com/qijiezhao/pytorch-ssd) instead of this code. With this code, I can meet the performance which written at SSD paper.

cvtower commented 5 years ago

I use another SSD code (https://github.com/qijiezhao/pytorch-ssd) instead of this code. With this code, I can meet the performance which written at SSD paper.

Hi @kimna4 , Is the imagenet pretrained model needed to reproduce the performance, Or training from scratch could also repfoduce?

Thanks very much for your help!

kimna4 commented 5 years ago

Hi @cvtower ,

You can get the pretrained model from here ( https://github.com/amdegroot/ssd.pytorch ). I think that the repository is a master code. So you can get a lot of information here.

Thank you

1453042287 commented 5 years ago

i don't know why but i use the same model to finetune the BDD100K dataset, and i get a quite well result: AP for bike = 0.2777 AP for bus = 0.4525 AP for car = 0.4817 AP for motor = 0.2510 AP for person = 0.2840 AP for rider = 0.2626 AP for traffic light = 0.1715 AP for traffic sign = 0.2024 AP for train = 0.0001 AP for truck = 0.4366 Mean AP = 0.2820

cvtower commented 5 years ago

i don't know why but i use the same model to finetune the BDD100K dataset, and i get a quite well result: AP for bike = 0.2777 AP for bus = 0.4525 AP for car = 0.4817 AP for motor = 0.2510 AP for person = 0.2840 AP for rider = 0.2626 AP for traffic light = 0.1715 AP for traffic sign = 0.2024 AP for train = 0.0001 AP for truck = 0.4366 Mean AP = 0.2820

Hi, This problem will be met when training from scratch, and the pre-trained model could almost reproduce the result.

cvtower commented 5 years ago

Hi all,

After checking the source code and cfg files, i found that the default .yml cfg file for most network contains only 'test' phase, that is no training will ever happen during default "training". I could train from scratch normally now.

To solve this issue:

  1. modify the .yml file-add train into the phase list , and prepare corresponding datasets
  2. if you use pytorch 0.4.0 and met other errors, previous issues will provide solution.
whuzs commented 5 years ago

why i run the demo, it's none result?

ids, count = nms(boxes, scores, self.nms_thresh, self.top_k) ValueError: not enough values to unpack (expected 2, got 0)

blueardour commented 5 years ago

@whuzs see https://github.com/ShuangXieIrene/ssds.pytorch/issues/15 please

blueardour commented 5 years ago

@whuzs also try: add 'scores.size(0) == 0' in detection.py as follows: scores = conf_scores[cl][c_mask] if scores.size(0) == 0 or scores.dim() == 0: continue

qiaoyaya2011 commented 4 years ago

@cvtower hi, after i modify the .yml file-add train into the phase list ,i also meet the same problem. AP for human0 = 0.0000 AP for head = 0.0000 AP for cloth = 0.0000 AP for fire = 0.0000 Mean AP = 0.0000

Results:
0.000
0.000
0.000
0.000
0.000

but torch version is 1.3.0

qiaoyaya2011 commented 4 years ago

@cvtower i have solved it

goodlixu commented 4 years ago

@cvtower i have solved it

hello, I met the same problem, can you tell me how did you solve this problem?

foreverYoungGitHub commented 3 years ago

I think the initialization weights in the master branch has some issues. That cause the problem for low AP when we train from scratch. But it should be fixed by the dev branch. Please try the code in the dev branch. Will close the issues for now.