jiawei-ren / BalancedMetaSoftmax-Classification

[NeurIPS 2020] Balanced Meta-Softmax for Long-Tailed Visual Recognition
https://github.com/jiawei-ren/BalancedMetaSoftmax
Other
135 stars 26 forks source link

About the data['meta'] #6

Closed blue-blue272 closed 3 years ago

blue-blue272 commented 3 years ago
       # use Class Balanced Sampler to create meta set
        data['meta'] = dataloader.load_data(data_root=data_root[dataset.rstrip('_LT')],
                                    dataset=dataset, phase='train' if 'CIFAR' in dataset else 'val',
                                    batch_size=sampler_defs.get('meta_batch_size', training_opt['batch_size'], ),
                                    sampler_dic=cbs_sampler_dic,
                                    num_workers=training_opt['num_workers'],
                                    cifar_imb_ratio=training_opt['cifar_imb_ratio'] if 'cifar_imb_ratio' in training_opt else None,
                                    meta=True)

In this code, I notice that you use the val data as the meta set. I think it will be unfair to compare to other methods since you use the validation set to train your network.

jiawei-ren commented 3 years ago

The gradient from the validation set does not update the network, it only updates the sample rate, which can be viewed as a way of hyper-parameter tuning. Recent work [1] adopts the same data split as well.

[1] Jamal et.al., Rethinking class-balanced methods for long-tailed recognition from a domain adaptation perspective

blue-blue272 commented 3 years ago

The gradient from the validation set does not update the network, it only updates the sample rate, which can be viewed as a way of hyper-parameter tuning. Recent work [1] adopts the same data split as well.

[1] Jamal et.al., Rethinking class-balanced methods for long-tailed recognition from a domain adaptation perspective

Thank you for your reply. I have one more question. When I use the 'ImageNet_LT/balms_resnet10.yaml' to train the model. It will out of GPU memory. Whether or not you will have this problem? And how many GPUS you use?

jiawei-ren commented 3 years ago

We carry out all experiments on a single NVIDIA V100 with 32 GB GPU memory. For ImageNet_LT/balms_resnet10.yaml, it should take ~22 GB of GPU memory to train, you may change the batch size to reduce the memory consumption.

jiawei-ren commented 3 years ago

I will close the issue for now. Feel free to open it if you have further questions.