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

AssertionError: Samples in split doesn't match samples in predictions. #11

Closed
taylorlulu opened this issue Jun 20, 2023 · 1 comment
Closed

Comments

@taylorlulu
Copy link

Traceback (most recent call last):
File "/home/lu/Workspace/FutureDet/tools/dist_test.py", line 270, in
main()
File "/home/lu/Workspace/FutureDet/tools/dist_test.py", line 260, in main
association_oracle=args.association_oracle, postprocess=args.postprocess, nogroup=args.nogroup)
File "/home/lu/Workspace/FutureDet/det3d/datasets/nuscenes/nuscenes.py", line 838, in evaluation
nogroup=nogroup
File "/home/lu/Workspace/FutureDet/det3d/datasets/nuscenes/nusc_common.py", line 686, in eval_main
nogroup=nogroup
File "/home/lu/anaconda3/envs/futuredet/lib/python3.7/site-packages/nuscenes/eval/detection/evaluate.py", line 225, in init
set(self.gt_boxes.sample_tokens))
AssertionError: Samples in split doesn't match samples in predictions.
As I the debug result shows the length of self.pred_boxes.sample_tokens is 404 doesn't match the length of self.gt_boxes.sample_tokens which is 81.

I was using the v1.0-mini dataaset, and I've changed the param in dist_test.py:
parser.add_argument("--split", default="mini_val") parser.add_argument("--version", default="v1.0-mini") parser.add_argument("--modelCheckPoint", default="latest")

This issue was is attributed to the inability to access the “val” dataset.
In the v1.0-mini dataset there are 323 training data samples and 81 testing data samples.
As I debug in the
if args.testset: print("Use Test Set") dataset = build_dataset(cfg.data.test) else: if args.split == "val" or args.split == "mini_val": print("Use Val Set") dataset = build_dataset(cfg.data.val) else: print("Use Train Set") cfg.data.val.info_path = cfg.data.val.info_path.replace("infos_val_%dsweeps_withvelo_filter_True"%(cfg.data.val.nsweeps), "infos_train_%dsweeps_withvelo_filter_True"%(cfg.data.val.nsweeps)) cfg.data.val.ann_file = cfg.data.val.info_path.replace("infos_val_%dsweeps_withvelo_filter_True"%(cfg.data.val.nsweeps), "infos_train_%dsweeps_withvelo_filter_True"%(cfg.data.val.nsweeps)) dataset = build_dataset(cfg.data.val)
However the output of the dataset.flag.shape is still 323 when I set the '--split' as "mini_val"
错误1
错误2
When the '--split' as "mini_train" is has the same output dataset.flag.shape = 323.
The result of dataset.flag.shape is supposed 81.
It seems that the cfg.data.val.info_path and cfg.data.ann_file dosen't work.
I can't figure out what could cause the problem, I'll thanks a lot if you can help.

@taylorlulu
Copy link
Author

I find the problem the issue is caused by incorrectly setting the info_path parameter.

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

1 participant