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

TypeError: impad() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given #247

Open
jiubie12 opened this issue Nov 2, 2023 · 1 comment

Comments

@jiubie12
Copy link

jiubie12 commented Nov 2, 2023

This error occurred during training. How to solve it?
Traceback (most recent call last):
File "tools/train.py", line 128, in
main()
File "tools/train.py", line 124, in main
timestamp=timestamp)
File "/root/autodl-tmp/SOLO/mmdet/apis/train.py", line 111, in train_detector
timestamp=timestamp)
File "/root/autodl-tmp/SOLO/mmdet/apis/train.py", line 297, in _non_dist_train
runner.run(data_loaders, cfg.workflow, cfg.total_epochs)
File "/root/miniconda3/envs/solo/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run
epoch_runner(data_loaders[i], **kwargs)
File "/root/miniconda3/envs/solo/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 47, in train
for i, data_batch in enumerate(self.data_loader):
File "/root/miniconda3/envs/solo/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in next
data = self._next_data()
File "/root/miniconda3/envs/solo/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1199, in _next_data
return self._process_data(data)
File "/root/miniconda3/envs/solo/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1225, in _process_data
data.reraise()
File "/root/miniconda3/envs/solo/lib/python3.7/site-packages/torch/_utils.py", line 429, in reraise
raise self.exc_type(msg)
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/root/miniconda3/envs/solo/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop
data = fetcher.fetch(index)
File "/root/miniconda3/envs/solo/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/miniconda3/envs/solo/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/autodl-tmp/SOLO/mmdet/datasets/custom.py", line 131, in getitem
data = self.prepare_train_img(idx)
File "/root/autodl-tmp/SOLO/mmdet/datasets/custom.py", line 144, in prepare_train_img
return self.pipeline(results)
File "/root/autodl-tmp/SOLO/mmdet/datasets/pipelines/compose.py", line 24, in call
data = t(data)
File "/root/autodl-tmp/SOLO/mmdet/datasets/pipelines/transforms.py", line 314, in call
self._pad_masks(results)
File "/root/autodl-tmp/SOLO/mmdet/datasets/pipelines/transforms.py", line 301, in _pad_masks
for mask in results[key]
File "/root/autodl-tmp/SOLO/mmdet/datasets/pipelines/transforms.py", line 301, in
for mask in results[key]
TypeError: impad() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given

@Sue-Tang-Up
Copy link

I find the same problem. Have you ever solved that?

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

2 participants