xingyizhou / CenterNet

Object detection, 3D detection, and pose estimation using center point detection:
MIT License
7.28k stars 1.93k forks source link

Test result is not normal #418

Open YongshengDong opened 5 years ago

YongshengDong commented 5 years ago

Hi, I trained a model using my own dataset, modified the num_classes and self.class_name in coco.py. It seems normal in training logs, but I can't find any box using test/demo.py, and mAP is 0. How can I solve this problem? Please help me!

YongshengDong commented 5 years ago

Snipaste_2019-10-22_20-23-35 Snipaste_2019-10-22_20-24-20

xingyizhou commented 5 years ago

You can visualize your output by --debug 2. Please make sure you haven't seen any drop parameters xxx or no parameters xxx when loading your model.

SFM2020 commented 5 years ago

How do you output accuracy and recall on your own dataset? Best wishes!

zjp99 commented 5 years ago

Hi, I trained a model using my own dataset, modified the num_classes and self.class_name in coco.py. It seems normal in training logs, but I can't find any box using test/demo.py, and mAP is 0. How can I solve this problem? Please help me!

Have you solved it? I get all AP=-1.000

YongshengDong commented 4 years ago

@zjp99 hi, I had solved it, just because some errors in my own dataset. I guess you can check your own dataset by setting --debug 4. Good luck!

Devoe-97 commented 4 years ago

Hi, I trained a model using kitti_2d dataset and ctdet with backbone hourglass104 and I got good mAP. However, when I used backbone of hourglass54 from cornernet-lite, the training logs seemed normal but I can't find any box using test/demo.py, and mAP is 0. How can I solve this problem? Please help me. This experiment is very important to me.

I use --debug 4 to check a photo from train set, and get the follow result: 1500ctdet 1500out_pred_1 0 1500pred_hm_1 0

Devoe-97 commented 4 years ago

@zjp99 hi, I had solved it, just because some errors in my own dataset. I guess you can check your own dataset by setting --debug 4. Good luck!

I want to know what errors in your dataset. Thanks

YongshengDong commented 4 years ago

@HuangDihe Hi, it's been too long since my last experiment, I just remembered there was a simple mistake that images and labels did not correspond. However, it is really strange if you only changed the backbone. Make sure the dataset is correct again by changing the backbone back. Good luck.

Devoe-97 commented 4 years ago

@HuangDihe Hi, it's been too long since my last experiment, I just remembered there was a simple mistake that images and labels did not correspond. However, it is really strange if you only changed the backbone. Make sure the dataset is correct again by changing the backbone back. Good luck.

I also change the resolution. I used hourglass104 with kitti dataset with resolution of 512512, and I used hourglass54 with kitti dataset with resolution of 3841280. I got good mAP using hourglass104 with resolution of 512512 but got 0 mAP using hourglass54 with resolution of 3841280.

YongshengDong commented 4 years ago

@HuangDihe Hi, it's been too long since my last experiment, I just remembered there was a simple mistake that images and labels did not correspond. However, it is really strange if you only changed the backbone. Make sure the dataset is correct again by changing the backbone back. Good luck.

I also change the resolution. I used hourglass104 with kitti dataset with resolution of 512_512, and I used hourglass54 with kitti dataset with resolution of 384_1280. I got good mAP using hourglass104 with resolution of 512_512 but got 0 mAP using hourglass54 with resolution of 384_1280.

So, there must be something wrong in your code. Check the backbone and neck.

Devoe-97 commented 4 years ago

@HuangDihe Hi, it's been too long since my last experiment, I just remembered there was a simple mistake that images and labels did not correspond. However, it is really strange if you only changed the backbone. Make sure the dataset is correct again by changing the backbone back. Good luck.

I also change the resolution. I used hourglass104 with kitti dataset with resolution of 512_512, and I used hourglass54 with kitti dataset with resolution of 384_1280. I got good mAP using hourglass104 with resolution of 512_512 but got 0 mAP using hourglass54 with resolution of 384_1280.

So, there must be something wrong in your code. Check the backbone and neck.

` class HourglassNet(exkp): def init(self, heads, num_stacks=2): n = 5 dims = [256, 256, 384, 384, 384, 512] modules = [2, 2, 2, 2, 2, 4]

    super(HourglassNet, self).__init__(
        n, num_stacks, dims, modules, heads,
        make_tl_layer=None,
        make_br_layer=None,
        make_pool_layer=make_pool_layer,
        make_hg_layer=make_hg_layer,
        kp_layer=residual, cnv_dim=256
    )

class HourglassNet54(exkp): def init(self, heads, num_stacks=3): n = 3 dims = [256, 384, 384, 512] modules = [1, 1, 1, 1]

    super(HourglassNet54, self).__init__(
        n, num_stacks, dims, modules, heads,
        make_tl_layer=None,
        make_br_layer=None,
        make_pool_layer=make_pool_layer,
        make_hg_layer=make_hg_layer,
        kp_layer=residual, cnv_dim=256
    )

` I create HourglassNet by this code and I used the layer fuctions from your code. I can't figure out what error in this backbone but I still thank you very much. what's more, It seems normal in training logs. The final val loss is about 0.5.

Devoe-97 commented 4 years ago

@HuangDihe Hi, it's been too long since my last experiment, I just remembered there was a simple mistake that images and labels did not correspond. However, it is really strange if you only changed the backbone. Make sure the dataset is correct again by changing the backbone back. Good luck.

I also change the resolution. I used hourglass104 with kitti dataset with resolution of 512_512, and I used hourglass54 with kitti dataset with resolution of 384_1280. I got good mAP using hourglass104 with resolution of 512_512 but got 0 mAP using hourglass54 with resolution of 384_1280.

So, there must be something wrong in your code. Check the backbone and neck.

I had solved my problem. 2 places in the code: ./src/lib/opts.py line 250: if opt.arch == 'hourglass': opt.num_stacks = 2 elif opt.arch == 'hourglass_54': opt.num_stacks = 3 else: opt.num_stacks = 1 ./src/lib/models/model.py line 27: arch = arch[:arch.find('_')] if '_' in arch else arch Commented out this code Pay special attention here because the name of the backbone I use is “hourglass_54” Everyone who wants to use other backbone please note this code. Thank you very much.

yr-zh commented 3 years ago

Hi, I trained a model using my own dataset, modified the num_classes and self.class_name in coco.py. It seems normal in training logs, but I can't find any box using test/demo.py, and mAP is 0. How can I solve this problem? Please help me!

Have you solved it? I get all AP=-1.000

Hello,I have the same problem , how did you solve it ? thx!