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

IndexError: boolean index did not match indexed array along dimension 0; dimension is 1199 but corresponding boolean dimension is 127533 #2

Open
Ckeai opened this issue Jan 27, 2024 · 5 comments

Comments

@Ckeai
Copy link

Ckeai commented Jan 27, 2024

Hello, I am very interested in your work. While replicating your code, I encountered an issue, as shown in the attached image. During training, the dimensions of valid_idxs do not match with the dimensions of the mean label mu_label. The mu_label is generated in the pseudo-label generation part of the code. This issue has been troubling me for quite some time, and I would appreciate your guidance on this matter.
IndexError

Traceback (most recent call last):
File "tools/train.py", line 351, in
main()
File "tools/train.py", line 342, in main
train(epoch, model, optimizer, scheduler, scaler, train_loader, cfg, logger, writer)
File "tools/train.py", line 64, in train
for i, batch in enumerate(train_loader, start=1):
File "/WANGboyue/wbw/anaconda3/envs/gapro_backup/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 681, in next
data = self._next_data()
File "/WANGboyue/wbw/anaconda3/envs/gapro_backup/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1376, in _next_data
return self._process_data(data)
File "/WANGboyue/wbw/anaconda3/envs/gapro_backup/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1402, in _process_data
data.reraise()
File "/WANGboyue/wbw/anaconda3/envs/gapro_backup/lib/python3.8/site-packages/torch/_utils.py", line 461, in reraise
raise exception
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/WANGboyue/wbw/anaconda3/envs/gapro_backup/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/WANGboyue/wbw/anaconda3/envs/gapro_backup/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/WANGboyue/wbw/anaconda3/envs/gapro_backup/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/WANGboyue/wbw/GaPro-master/ISBNet/isbnet/data/custom.py", line 174, in getitem
self.transform_train(xyz, rgb, semantic_label, instance_label, prob_label, mu_label, var_label, spp)
File "/WANGboyue/wbw/GaPro-master/ISBNet/isbnet/data/custom.py", line 148, in transform_train
mu_label = mu_label[valid_idxs]
IndexError: boolean index did not match indexed array along dimension 0; dimension is 1199 but corresponding boolean dimension is 127533

@ngoductuanlhp
Copy link
Collaborator

Could you double-check the initial shape of the semantic_label, instance_label, prob_label, mu_label when loading at here? If you process the pseudo-label correctly, all these tensors have the similar shape of (N) where N is the total number of points.

@Ckeai
Copy link
Author

Ckeai commented Feb 22, 2024

I followed the readme, but the variance and mean of the processed pseudo-labels are indeed incorrect in dimension.

@Stay-Naive
Copy link

I came across the same problem. Do you have any idea now to solve this problem? @ngoductuanlhp @Ckeai
By the way, when I check the code in gen_ps.py, the wall_box confused me. In gapro/scannet_planes.py/get_wall_boxes, this part of data seems to come from dataset/scannetv2/scannet_planes/. However, I downloaded and prepared the scannet dataset following the document, and I did not have this part of data. Also, I did not see any instruction about this.

@zyjhxd
Copy link

zyjhxd commented Oct 15, 2024

我遇到了同样的问题。您现在有什么想法可以解决这个问题吗?@ngoductuanlhp @Ckeai 顺便说一句,当我检查中的代码时gen_ps.py,让wall_box我感到困惑。在中gapro/scannet_planes.py/get_wall_boxes,这部分数据似乎来自dataset/scannetv2/scannet_planes/。但是,我按照文档下载并准备了 scannet 数据集,但我没有这部分数据。而且,我没有请参阅有关此的任何说明。

您好请问解决了吗

@zyjhxd
Copy link

zyjhxd commented Oct 15, 2024

我按照自述文件进行操作,但处理后的伪标签的方差和均值在维度上确实不正确。

您好请问解决了吗

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

4 participants