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

how to lower batch size #9

Open
ray8841 opened this issue Nov 11, 2022 · 0 comments
Open

how to lower batch size #9

ray8841 opened this issue Nov 11, 2022 · 0 comments

Comments

@ray8841
Copy link

ray8841 commented Nov 11, 2022

Hi, when I tried to lower the batch size. I got tensor error message from dataset.py. Is there anyway to properly lower the batch size without getting error message? I use rain1400 dataset.
Error message:
File "train.py", line 321, in
main()
File "train.py", line 305, in main
train_kc_stage(model, teacher_networks, ckt_modules, train_loader, optimizer, scheduler, epoch, criterions)
File "train.py", line 99, in train_kc_stage
for target_images, input_images in pBar:
File "/home/nccu/.local/lib/python3.7/site-packages/tqdm-4.64.0-py3.7.egg/tqdm/std.py", line 1195, in iter
for obj in iterable:
File "/home/nccu/anaconda3/envs/twostage/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 628, in next
data = self._next_data()
File "/home/nccu/anaconda3/envs/twostage/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 671, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/nccu/anaconda3/envs/twostage/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 61, in fetch
return self.collate_fn(data)
File "/home/nccu/Jason/Two-stage/utils/dataset.py", line 135, in call
input_images[i] = torch.cat(input_images[i])
RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 224 but got size 175 for tensor number 9 in the list.

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