tztztztztz / eqlv2

The official implementation of Equalization Loss v1 & v2 (CVPR 2020, 2021) based on MMDetection. https://arxiv.org/abs/2012.08548 https://arxiv.org/abs/2003.05176
Apache License 2.0
158 stars 23 forks source link

How to train EQL v2 with my imbalance dataset( coco_type format)? #24

Closed lyon-v closed 2 years ago

lyon-v commented 2 years ago

Hi, I want to train EQL v2 with my dataset ,not LVIS . And my dataset is not balance. I modify the dataset path in config. And Where should I modify in the code.

lyon-v commented 2 years ago

Traceback (most recent call last): File "/home/wuliang/cvpro/eqlv2-master/mmdet/datasets/openimage.py", line 106, in evaluate from .openimage_eval import OpenimageEval ModuleNotFoundError: No module named 'mmdet.datasets.openimage_eval'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "./tools/train.py", line 153, in main() File "./tools/train.py", line 149, in main meta=meta) File "/home/wuliang/cvpro/eqlv2-master/mmdet/apis/train.py", line 143, in train_detector runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/home/wuliang/anaconda3/envs/mmlab6/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 122, in run epoch_runner(data_loaders[i], kwargs) File "/home/wuliang/anaconda3/envs/mmlab6/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 46, in train self.call_hook('after_train_epoch') File "/home/wuliang/anaconda3/envs/mmlab6/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 298, in call_hook getattr(hook, fn_name)(self) File "/home/wuliang/cvpro/eqlv2-master/mmdet/core/evaluation/eval_hooks.py", line 74, in after_train_epoch self.evaluate(runner, results) File "/home/wuliang/cvpro/eqlv2-master/mmdet/core/evaluation/eval_hooks.py", line 32, in evaluate results, logger=runner.logger, self.eval_kwargs) File "/home/wuliang/cvpro/eqlv2-master/mmdet/datasets/openimage.py", line 108, in evaluate raise ImportError('Please follow config/lvis/README.md to ' ImportError: Please follow config/lvis/README.md to install open-mmlab forked lvis first.

tztztztztz commented 2 years ago

Since the format is coco-like, I recommend creating a new class inherited from LVIS.

@DATASETS.register_module()
class YourDataset(LVISDataset):
    CLASSES = ['name1', 'name2']
lyon-v commented 2 years ago

thanks.