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

Some Error #4

Closed
CSer-Tang-hao opened this issue Jul 12, 2020 · 2 comments
Closed

Some Error #4

CSer-Tang-hao opened this issue Jul 12, 2020 · 2 comments
Labels
question Further information is requested

Comments

@CSer-Tang-hao
Copy link

This is an inspiring work, but when I try to train without any modify, I meet some trouble:
[I:1279/131900][E:0:50]>[MINet_VGG16_e_40_lr_0.025_opti_f3trick_sche_Poly][Lr:0.0001000,0.0010000][Avg:0.40408|Cur:0.38437|['0.19423', '0.19013']]
Exception in thread Thread-3:
Traceback (most recent call last):
File "/home/th/anaconda3/envs/pytorch1.2.0/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/home/th/anaconda3/envs/pytorch1.2.0/lib/python3.6/site-packages/prefetch_generator/init.py", line 80, in run
for item in self.generator:
File "/home/th/anaconda3/envs/pytorch1.2.0/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 819, in next
return self._process_data(data)
File "/home/th/anaconda3/envs/pytorch1.2.0/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data
data.reraise()
File "/home/th/anaconda3/envs/pytorch1.2.0/lib/python3.6/site-packages/torch/_utils.py", line 385, in reraise
raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in DataLoader worker process 2.
Original Traceback (most recent call last):
File "/home/th/anaconda3/envs/pytorch1.2.0/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/home/th/anaconda3/envs/pytorch1.2.0/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "/data/SOD/MINet/code/utils/imgs/create_loader_imgs.py", line 24, in _collate_fn
mask = torch.stack(mask, dim=0)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 4 and 1 in dimension 1 at /tmp/pip-req-build-vxpey3tb/aten/src/TH/generic/THTensor.cpp:689

@lartpang
Copy link
Owner

lartpang commented Jul 12, 2020

The problem comes from here https://github.com/lartpang/MINet/blob/master/code/utils/imgs/create_loader_imgs.py#L19 . Because you need to ensure that the mask (https://github.com/lartpang/MINet/blob/master/code/utils/imgs/create_loader_imgs.py#L24) is a list of tensors with the same size, that is, the requirements of the stack function need to be met.

@CSer-Tang-hao
Copy link
Author

The problem comes from here https://github.com/lartpang/MINet/blob/master/code/utils/imgs/create_loader_imgs.py#L19 . Because you need to ensure that the mask (https://github.com/lartpang/MINet/blob/master/code/utils/imgs/create_loader_imgs.py#L24) is a list of tensors with the same size, that is, the requirements of the stack function need to be met.

Thanks! I have sent you an email in the hope of further communication.

@lartpang lartpang added the question Further information is requested label Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants