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

对于自己的数据集,在build时不会创建flag变量,导致group_sampler出错 #19

Closed
zebbsb opened this issue Apr 13, 2023 · 3 comments

Comments

@zebbsb
Copy link

zebbsb commented Apr 13, 2023

十分感谢您分享的代码以及您工作对我的论文的启发!但是在我在单gpu运行时,遇到了和[https://github.com//issues/14#issue-1559569880]相同的问题,在运行到/boxlevelset/mmdet/datasets/samplers/group_sampler.py文件中第36行的: indices = np.concatenate(indices)时,报错:
File "<array_function internals>",line 6, in concatenate
ValueError: need at least one array to concatenate.
我在debug后发现是因为我的数据集尽管做成了coco格式,但是在train.py中调用build_datasets会运行到最后的else分支,并且调用build_from_cfg(cfg, DATASETS, default_args),但这个方法没有像其他的分支中的方法一样在创建dataset对象时定义flag变量。从而使得Group_sampler类在初始化的时候,self.flag.self.group_sizes都是空对象,从而导致indices也是空对象,发生这个错误。请问是否有解决的办法呢?我已经验证过数据,并没有错误的标注,数据集是可以被cocoAPI调用的。

@zebbsb
Copy link
Author

zebbsb commented Apr 13, 2023

Solution: wrong class for coco dataset in datasets/coco.py

@zebbsb zebbsb closed this as completed Apr 13, 2023
@SSZ1
Copy link

SSZ1 commented Jun 21, 2024

Solution: wrong class for coco dataset in datasets/coco.py

您好,我想咨询一下您,具体是怎么解决的呢,没看懂这个,这个coco.py文件是在哪里呢

@zebbsb
Copy link
Author

zebbsb commented Jun 22, 2024

Solution: wrong class for coco dataset in datasets/coco.py

您好,我想咨询一下您,具体是怎么解决的呢,没看懂这个,这个coco.py文件是在哪里呢

这个问题是由于自己设置的数据集的类别与在mmdet框架下默认的coco数据集类别不一致导致的,需要修改项目路径下的mmdet文件夹中的datasets/coco.py中默认的coco数据集的CLASSES,让里面的类别标注名称和自己的数据集相同,我是这么解决的

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