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

I met an issue when I run the train.py #6

Open
haimeilv opened this issue May 1, 2022 · 0 comments
Open

I met an issue when I run the train.py #6

haimeilv opened this issue May 1, 2022 · 0 comments

Comments

@haimeilv
Copy link

haimeilv commented May 1, 2022

I met an issue when I run the train.py

当我用train.py训练WHU数据集时,遇到了下面的问题:

`
epoch 0/99
0%| | 0/539 [00:00<?, ?it/s]/root/miniconda3/lib/python3.8/site-packages/torch/nn/functional.py:3454: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
warnings.warn(
d2_out.shape torch.Size([4, 2, 256, 256])
labels.shape torch.Size([4, 3, 256, 256])
0%| | 0/539 [00:01<?, ?it/s]
Traceback (most recent call last):
File "/tmp/pycharm_project_524/my_yaogan/train_EGRCNN.py", line 86, in
val_acc, train_loss = UNet_mloss_train.train_model(UNet_mlstm, dataloaders_dict, criterion, criterion1, optimizer, sc_plt, device, num_epochs=num_epochs)
File "/tmp/pycharm_project_524/my_yaogan/UNet_mloss_train.py", line 60, in train_model
loss_seg_2 = criterion(d2_out, labels)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/tmp/pycharm_project_524/my_yaogan/losses.py", line 23, in forward
logpt = logpt.gather(1, target)
RuntimeError: Size does not match at dimension 0 expected index [786432, 1] to be smaller than src [262144, 2] apart from dimension 1

Process finished with exit code 1

Excuse me, can you upload some training datasets? What can I do to solve this problem?

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