-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
IndexError: index 26 is out of bounds for axis 1 with size 6 #3055
Comments
I thought it might be the problem with flip_test,so I changed flip_test=False,but still got same error: IndexError: index 26 is out of bounds for axis 1 with size 6 Then I comment RandomFlip line in train_pipeline, I get the error:
|
RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 133 but got size 136 for tensor number 3 in the list. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisite
Environment
When I train custom datasets,I got this error. For now ,I don't know what cause this problem.
Reproduces the problem - code sample
My config file
Reproduces the problem - command or script
My custom dataset
Reproduces the problem - error message
Traceback (most recent call last):
File "/home/lab/Anaconda_project/mmpose/tools/train.py", line 162, in
main()
File "/home/lab/Anaconda_project/mmpose/tools/train.py", line 158, in main
runner.train()
File "/home/lab/.local/lib/python3.10/site-packages/mmengine/runner/runner.py", line 1777, in train
model = self.train_loop.run() # type: ignore
File "/home/lab/.local/lib/python3.10/site-packages/mmengine/runner/loops.py", line 96, in run
self.run_epoch()
File "/home/lab/.local/lib/python3.10/site-packages/mmengine/runner/loops.py", line 112, in run_epoch
for idx, data_batch in enumerate(self.dataloader):
File "/home/lab/anaconda3/envs/py10_cuda118_torch200/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 634, in next
data = self._next_data()
File "/home/lab/anaconda3/envs/py10_cuda118_torch200/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1346, in _next_data
return self._process_data(data)
File "/home/lab/anaconda3/envs/py10_cuda118_torch200/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1372, in _process_data
data.reraise()
File "/home/lab/anaconda3/envs/py10_cuda118_torch200/lib/python3.10/site-packages/torch/_utils.py", line 644, in reraise
raise exception
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/lab/anaconda3/envs/py10_cuda118_torch200/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/home/lab/anaconda3/envs/py10_cuda118_torch200/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/lab/anaconda3/envs/py10_cuda118_torch200/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/lab/.local/lib/python3.10/site-packages/mmengine/dataset/base_dataset.py", line 410, in getitem
data = self.prepare_data(idx)
File "/home/lab/.local/lib/python3.10/site-packages/mmengine/dataset/base_dataset.py", line 115, in wrapper
return old_func(obj, *args, **kwargs)
File "/home/lab/Anaconda_project/mmpose/mmpose/datasets/datasets/base/base_coco_style_dataset.py", line 170, in prepare_data
return self.pipeline(data_info)
File "/home/lab/anaconda3/envs/py10_cuda118_torch200/lib/python3.10/site-packages/mmcv/transforms/base.py", line 12, in call
return self.transform(results)
File "/home/lab/anaconda3/envs/py10_cuda118_torch200/lib/python3.10/site-packages/mmcv/transforms/wrappers.py", line 88, in transform
results = t(results) # type: ignore
File "/home/lab/anaconda3/envs/py10_cuda118_torch200/lib/python3.10/site-packages/mmcv/transforms/base.py", line 12, in call
return self.transform(results)
File "/home/lab/Anaconda_project/mmpose/mmpose/datasets/transforms/common_transforms.py", line 239, in transform
keypoints, keypoints_visible = flip_keypoints(
File "/home/lab/Anaconda_project/mmpose/mmpose/structures/keypoint/transforms.py", line 52, in flip_keypoints
keypoints = keypoints.take(flip_indices, axis=ndim - 2)
IndexError: index 26 is out of bounds for axis 1 with size 6
Additional information
No response
The text was updated successfully, but these errors were encountered: