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

An error occurs when running ChangeFormerV2 #114

Open
Hank-user opened this issue Feb 21, 2025 · 0 comments
Open

An error occurs when running ChangeFormerV2 #114

Hank-user opened this issue Feb 21, 2025 · 0 comments

Comments

@Hank-user
Copy link

G_pred shape: torch.Size([8, 2, 256, 256])
G_pred[-1] shape: torch.Size([2, 256, 256])
gt shape: torch.Size([8, 1, 256, 256])
0%| | 0/890 [00:01<?, ?it/s]
Traceback (most recent call last):
File "F:\ChangeDetection\ChangeFormer\main_cd.py", line 84, in
train(args)
File "F:\ChangeDetection\ChangeFormer\main_cd.py", line 15, in train
model.train_models()
File "F:\ChangeDetection\ChangeFormer\models\trainer.py", line 341, in train_models
self._backward_G()
File "F:\ChangeDetection\ChangeFormer\models\trainer.py", line 317, in _backward_G
self.G_loss = self._pxl_loss(self.G_pred[-1], gt)
File "F:\ChangeDetection\ChangeFormer\models\losses.py", line 20, in cross_entropy
return F.cross_entropy(input=input, target=target, weight=weight,
File "D:\Major app\anaconda3\envs\pytorch\lib\site-packages\torch\nn\functional.py", line 3059, in cross_entropy
return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
ValueError: Expected input batch_size (2) to match target batch_size (8).

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