Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

An error occurs when batch_size is set to 2 or more. #28

Open
hyeon1263 opened this issue Nov 1, 2023 · 1 comment
Open

An error occurs when batch_size is set to 2 or more. #28

hyeon1263 opened this issue Nov 1, 2023 · 1 comment

Comments

@hyeon1263
Copy link

Traceback (most recent call last):
File "/home/mvp/run/train_3d.py", line 473, in
main()
File "/home/mvp/run/train_3d.py", line 309, in main
train_3d(config, model, optimizer, train_loader, epoch,
File "/home/mvp/run/../lib/core/function.py", line 65, in train_3d
out, loss_dict = model(views=inputs, meta=meta)
File "/home/anaconda3/envs/mvp_voxelpose/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/anaconda3/envs/mvp_voxelpose/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 1008, in forward
output = self._run_ddp_forward(*inputs, **kwargs)
File "/home/anaconda3/envs/mvp_voxelpose/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 969, in _run_ddp_forward
return module_to_run(*inputs[0], **kwargs[0])
File "/home/anaconda3/envs/mvp/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/mvp/run/../lib/models/multi_view_pose_transformer.py", line 318, in forward
get_rays_new(self.image_size,
File "/home/mvp/run/../lib/models/position_encoding.py", line 272, in get_rays_new
pixel_camera = torch.bmm(xy1.flatten(1, 2).repeat(views, 1, 1),
RuntimeError: Expected size for first two dimensions of batch2 tensor to be: [2, 3] but got: [8, 3]

I ran training with batch_size=4, but this error occurred. Does anyone know how to fix it?

@twangnh
Copy link
Collaborator

twangnh commented Nov 1, 2023

hi, batch size larger than 1/per gpu is not supported, please modify the code or try the https://github.com/openxrlab/xrmocap implementation

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants