Anttwo / SuGaR

[CVPR 2024] Official PyTorch implementation of SuGaR: Surface-Aligned Gaussian Splatting for Efficient 3D Mesh Reconstruction and High-Quality Mesh Rendering
https://anttwo.github.io/sugar/
Other
2.21k stars 166 forks source link

RuntimeError: shape is invalid for input of size #149

Open rapon232 opened 7 months ago

rapon232 commented 7 months ago

I have done evetything correctly and i am getting this error! Why does the input shape not match my image dimensions? Why is it initializing randomly (it changes every time I run it)?

Traceback (most recent call last): File "/content/SuGaR/train.py", line 127, in coarse_sugar_path = coarse_training_with_density_regularization(coarse_args) File "/content/SuGaR/sugar_trainers/coarse_density.py", line 526, in coarse_training_with_density_regularization gt_rgb = gt_image.view(-1, sugar.image_height, sugar.image_width, 3) RuntimeError: shape '[-1, 1024, 1920, 3]' is invalid for input of size 6059520

ywaison commented 6 months ago

I have done evetything correctly and i am getting this error! Why does the input shape not match my image dimensions? Why is it initializing randomly (it changes every time I run it)?

Traceback (most recent call last): File "/content/SuGaR/train.py", line 127, in coarse_sugar_path = coarse_training_with_density_regularization(coarse_args) File "/content/SuGaR/sugar_trainers/coarse_density.py", line 526, in coarse_training_with_density_regularization gt_rgb = gt_image.view(-1, sugar.image_height, sugar.image_width, 3) RuntimeError: shape '[-1, 1024, 1920, 3]' is invalid for input of size 6059520

I think the resolution of the images you input is not all the same, so this is the cause of the problem

GoroYeh-HRI commented 3 months ago

I have done evetything correctly and i am getting this error! Why does the input shape not match my image dimensions? Why is it initializing randomly (it changes every time I run it)?

Traceback (most recent call last): File "/content/SuGaR/train.py", line 127, in coarse_sugar_path = coarse_training_with_density_regularization(coarse_args) File "/content/SuGaR/sugar_trainers/coarse_density.py", line 526, in coarse_training_with_density_regularization gt_rgb = gt_image.view(-1, sugar.image_height, sugar.image_width, 3) RuntimeError: shape '[-1, 1024, 1920, 3]' is invalid for input of size 6059520

I got exactly the same errors. @ywaison I used the same set of input/images to run this script. I believe the resolution of images are the same. Is there any possible reasons I'm encountering this error? Thank you very much.

GoroYeh-HRI commented 3 months ago

All my input images are size 1280 x 720 image

However, when I checked the cameras.json output from gaussian_splatting/train.py, the resolutions are various and not the same as my image size.

image

I think this might be the reason why there would be a shape mismatch when training the SuGaR model. Do you know why this happened? Thank you very much.

projan-shakya commented 2 months ago

@GoroYeh-HRI are You using hierarchical colmap mapper? I have the same issue going on rn. Did you fix it?

misakamage commented 2 months ago

I have the same issue