-
Notifications
You must be signed in to change notification settings - Fork 392
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
train pspnet error #49
Comments
I meet this problem too |
I have solved this problem.You should set train_batch_size>=2 |
Thank you. I tried to set train_batch_size=4 or 6, while this didn't work. Maybe anything else to correct? |
You should fix the input large image to the same size. |
wow, done! |
When I train pspnet, set batch=2, it appears:
[epoch 1], [iter 10 / 4249], [train main loss 1.44544], [train aux loss 2.11281]. [lr 0.0049986500]
[epoch 1], [iter 20 / 4249], [train main loss 1.35266], [train aux loss 1.68135]. [lr 0.0049971499]
Traceback (most recent call last):
File "./train/voc-psp_net/train.py", line 258, in
main()
File "./train/voc-psp_net/train.py", line 111, in main
train(train_loader, net, criterion, optimizer, curr_epoch, args, val_loader, visualize)
File "./train/voc-psp_net/train.py", line 119, in train
for i, data in enumerate(train_loader):
File "/share/home/math8/.conda/envs/pytorch0.4.0_py3.5/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 286, in next
return self._process_next_batch(batch)
File "/share/home/math8/.conda/envs/pytorch0.4.0_py3.5/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 307, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
RuntimeError: Traceback (most recent call last):
File "/share/home/math8/.conda/envs/pytorch0.4.0_py3.5/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 57, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/share/home/math8/.conda/envs/pytorch0.4.0_py3.5/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 138, in default_collate
return [default_collate(samples) for samples in transposed]
File "/share/home/math8/.conda/envs/pytorch0.4.0_py3.5/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 138, in
return [default_collate(samples) for samples in transposed]
File "/share/home/math8/.conda/envs/pytorch0.4.0_py3.5/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 115, in default_collate
return torch.stack(batch, 0, out=out)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 4 and 2 in dimension 1 at /opt/conda/conda-bld/pytorch_1524580978845/work/aten/src/TH/generic/THTensorMath.c:3586
i don't know how to solve it?
The text was updated successfully, but these errors were encountered: