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 67108864 #87

Open
weizhiliang0520 opened this issue Nov 26, 2021 · 2 comments

Comments

@weizhiliang0520
Copy link

tcmalloc: large alloc 2147483648 bytes == 0x55577043e000 @ 0x7ff56448eb6b 0x7ff5644ae379 0x7ff463c93cde 0x7ff463c95452 0x7ff4b5cbccf3 0x7ff4b5d44158 0x7ff4b641b49f 0x7ff4b63fb870 0x7ff4b61e648a 0x7ff4b5d3529d 0x7ff4b6514aca 0x7ff4b63f770e 0x7ff4b5fbcd17 0x7ff4b791f7c4 0x7ff4b791fc8d 0x7ff4b60326e8 0x7ff4b5d333d5 0x7ff4b659b970 0x7ff4b62e8069 0x7ff55f0f42c3 0x7ff55f24e04e 0x5557057cf4b0 0x5557058c0e1d 0x555705842e99 0x55570583d9ee 0x5557057d0bda 0x55570583f737 0x5557057d0afa 0x55570583e915 0x55570583d9ee 0x55570583d6f3
Traceback (most recent call last):
File "train.py", line 169, in
miou_current = val(opt, model)
File "train.py", line 86, in val
score = model.test(val=True) # run inference
File "/content/drive/MyDrive/Experiment/codes/33_STANet/STANet/models/CDF0_model.py", line 77, in test
metrics.update(self.L.detach().cpu().numpy(), pred.detach().cpu().numpy())
File "/content/drive/MyDrive/Experiment/codes/33_STANet/STANet/util/metrics.py", line 121, in update
self.confusion_matrix += self.__fast_hist(lt.flatten(), lp.flatten())
File "/content/drive/MyDrive/Experiment/codes/33_STANet/STANet/util/metrics.py", line 108, in __fast_hist
hist = np.bincount(self.num_classes * label_gt[mask].astype(int) + label_pred[mask],
IndexError: boolean index did not match indexed array along dimension 0; dimension is 67108864 but corresponding boolean dimension is 1048576

@yilye
Copy link

yilye commented Apr 9, 2022

CDFA_model.py
insert 93 line: self.dist = torch.transpose(self.dist, 1, 3)
...
self.dist = F.pairwise_distance(self.feat_A, self.feat_B, keepdim=True) # 特征距离
self.dist = torch.transpose(self.dist, 1, 3)
self.dist = F.interpolate(self.dist, size=self.A.shape[2:], mode='bilinear',align_corners=True)
...

@wang673523745
Copy link

降低numpy的版本即可

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

3 participants