Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'COCO' object has no attribute 'get_cat_ids' #3

Closed
liliwannian opened this issue Oct 13, 2021 · 3 comments
Closed

'COCO' object has no attribute 'get_cat_ids' #3

liliwannian opened this issue Oct 13, 2021 · 3 comments

Comments

@liliwannian
Copy link

First of all, thank you for your contribution.I encountered the following problems when reproducing your code.Rsaicp2_new is my own dataset.When I tried to train, the following problems occurred.

error:

Traceback (most recent call last):
  File "tools/train.py", line 190, in <module>
    main()
  File "tools/train.py", line 167, in main
    datasets = [build_dataset(cfg.data.train)]
  File "/home/tongjiaxing/competition/DARDet-cgh/mmdet/datasets/builder.py", line 67, in build_dataset
    build_dataset(cfg['dataset'], default_args), cfg['oversample_thr'])
  File "/home/tongjiaxing/competition/DARDet-cgh/mmdet/datasets/builder.py", line 71, in build_dataset
    dataset = build_from_cfg(cfg, DATASETS, default_args)
  File "/home/tongjiaxing/anaconda3/envs/dar/lib/python3.7/site-packages/mmcv/utils/registry.py", line 55, in build_from_cfg
    raise type(e)(f'{obj_cls.__name__}: {e}')
AttributeError: Rsaicp2_new: 'COCO' object has no attribute 'get_cat_ids'

I hope you can answer the questions in your busy schedule.

@zf020114
Copy link
Owner

Thank you very much for your interest in our work.
I think the problem comes from the file changes the API names for COCO in the coco.py file.
You can fix the bug by reinstall the mmdet compatible version of cocoAPI by
pip install -U "git+https://github.com/open-mmlab/cocoapi.git#subdirectory=pycocotools"

@zf020114
Copy link
Owner

You can see
open-mmlab/mmdetection#2913

@liliwannian
Copy link
Author

It has been resolved, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants