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

IndexError: too many indices for tensor of dimension 4 #3

Closed
shi3z opened this issue Dec 27, 2023 · 1 comment
Closed

IndexError: too many indices for tensor of dimension 4 #3

shi3z opened this issue Dec 27, 2023 · 1 comment

Comments

@shi3z
Copy link

shi3z commented Dec 27, 2023

Hi!

I tried your code. but error occurred.
Could you help me?
Please give me advice.

$ python train_stage1.py 2023-12-27 09:32:44,487 INFO [human_loader.py:133] Using local data in /home/shi3z/git/GPS-Gaussian/render_data/rectified_local/train ... 2023-12-27 09:32:44,583 INFO [human_loader.py:133] Using local data in /home/shi3z/git/GPS-Gaussian/render_data/rectified_local/val ... 0%| | 0/40000 [00:14<?, ?it/s] Traceback (most recent call last): File "/home/shi3z/git/GPS-Gaussian/train_stage1.py", line 175, in <module> trainer.train() File "/home/shi3z/git/GPS-Gaussian/train_stage1.py", line 56, in train _, flow_loss, metrics = self.model(data) File "/home/shi3z/.pyenv/versions/miniconda3-4.7.12/envs/gps_gaussian/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/home/shi3z/git/GPS-Gaussian/lib/network.py", line 37, in forward flow_loss, metrics = sequence_loss(flow_predictions, flow, valid) File "/home/shi3z/git/GPS-Gaussian/lib/loss.py", line 15, in sequence_loss assert not torch.isinf(flow_gt[valid.bool()]).any() IndexError: too many indices for tensor of dimension 4

@ShunyuanZheng
Copy link
Collaborator

ShunyuanZheng commented Dec 27, 2023

Sorry, there exists a bug in the early version of human_loader.py . Please pull the latest repository, or rectify the read_img function in human_loader.py's L88-L90.

Also, we re-upload the real-world test data in netdisk since some masks have 4 channels in the previous zip file which could arouse another error using the modified dataloader. We post-processed those masks to ensure all masks have 3 channels.

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