dunbar12138 / pix2pix3D

pix2pix3D: Generating 3D Objects from 2D User Inputs
http://www.cs.cmu.edu/~pix2pix3D/
MIT License
1.65k stars 132 forks source link

AssertionError: Wrong size for dimension 1: got 6, expected 8 #34

Open MKattaa opened 8 months ago

MKattaa commented 8 months ago

How many image views are required for model training? When running the training script, I get the following message:

-- Process 0 terminated with the following error: Traceback (most recent call last): File "/opt/conda/envs/pix2pix3d/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 68, in _wrap fn(i, *args) File "/workspaces/3d_nlp/pix2pix3D/train.py", line 57, in subprocess_fn training_loop.training_loop(rank=rank, c) File "/workspaces/3d_nlp/pix2pix3D/training/training_loop.py", line 331, in training_loop misc.print_module_summary(D, [img, c]) File "/workspaces/3d_nlp/pix2pix3D/torch_utils/misc.py", line 230, in print_module_summary outputs = module(inputs) File "/opt/conda/envs/pix2pix3d/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl return self._call_impl(args, kwargs) File "/opt/conda/envs/pix2pix3d/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1561, in _call_impl result = forward_call(args, kwargs) File "/workspaces/3d_nlp/pix2pix3D/training/dual_discriminator.py", line 165, in forward x, img = block(x, img, block_kwargs) File "/opt/conda/envs/pix2pix3d/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl return self._call_impl(args, *kwargs) File "/opt/conda/envs/pix2pix3d/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1561, in _call_impl result = forward_call(args, kwargs) File "/workspaces/3d_nlp/pix2pix3D/training/networks_stylegan2.py", line 623, in forward misc.assert_shape(img, [None, self.img_channels, self.resolution, self.resolution]) File "/workspaces/3d_nlp/pix2pix3D/torch_utils/misc.py", line 97, in assert_shape raise AssertionError(f'Wrong size for dimension {idx}: got {size}, expected {ref_size}') AssertionError: Wrong size for dimension 1: got 6, expected 8**

Could the issue stem from having only 6 image views in my dataset, or might there be other factors contributing to the problem? Any assistance would be greatly appreciated.

dunbar12138 commented 7 months ago

It's probably because the training set only has 6 images. You can try using a smaller batch size, e.g., 1 or 2, and disable multi-GPU training.