You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to use EG3D for grayscale images.
When I was using the original image = image[:, :, np.newaxis] # HW => HWC
it didn't work for me. It gave me this error:
Exception has occurred: AssertionError
Wrong size for dimension 1: got 6, expected 2
File "/home/anya/Programs/eg3d/eg3d/torch_utils/misc.py", line 97, in assert_shape
raise AssertionError(f'Wrong size for dimension {idx}: got {size}, expected {ref_size}')
File "/home/anya/Programs/eg3d/eg3d/training/networks_stylegan2.py", line 621, in forward
misc.assert_shape(img, [None, self.img_channels, self.resolution, self.resolution]) # where does the img come from?
File "/home/anya/Programs/eg3d/eg3d/training/dual_discriminator.py", line 164, in forward
x, img = block(x, img, **block_kwargs)
File "/home/anya/Programs/eg3d/eg3d/torch_utils/misc.py", line 218, in print_module_summary
outputs = module(*inputs)
File "/home/anya/Programs/eg3d/eg3d/training/training_loop.py", line 178, in training_loop
misc.print_module_summary(D, [img, c])
File "/home/anya/Programs/eg3d/eg3d/train.py", line 52, in subprocess_fn
training_loop.training_loop(rank=rank, **c)
File "/home/anya/Programs/eg3d/eg3d/train.py", line 101, in launch_training
subprocess_fn(rank=0, c=c, temp_dir=temp_dir)
File "/home/anya/Programs/eg3d/eg3d/train.py", line 402, in main
launch_training(c=c, desc=desc, outdir=opts.outdir, dry_run=opts.dry_run)
File "/home/anya/Programs/eg3d/eg3d/train.py", line 407, in <module>
main() # pylint: disable=no-value-for-parameter
AssertionError: Wrong size for dimension 1: got 6, expected 2
Therefore, I changed it to image = np.stack((image,)*3, axis=-1) # HW => HWC, but C is not 1, but 3
so I treat the images as RGB, but I was hoping to change the code to work with the images like grayscale and I got confused about the used dimensions/tensor shapes.
I have tried to change the img_channels here to 32 * 1 (assuming that the original 32 * 3 had 3 for RGB), but then it doesn't fit with other shapes later in the code which seems to be connected to the triplane size, not the RGB colour. I guess I need to keep the triplane representation (which I guess stands for the 3D geometry, not colour)...
If anyone could explain me a bit more I would be glad. Thank you :)
The text was updated successfully, but these errors were encountered:
Hi, I am trying to use EG3D for grayscale images.
When I was using the original
image = image[:, :, np.newaxis] # HW => HWC
it didn't work for me. It gave me this error:
Therefore, I changed it to
image = np.stack((image,)*3, axis=-1) # HW => HWC, but C is not 1, but 3
so I treat the images as RGB, but I was hoping to change the code to work with the images like grayscale and I got confused about the used dimensions/tensor shapes.
I have tried to change the img_channels here to 32 * 1 (assuming that the original 32 * 3 had 3 for RGB), but then it doesn't fit with other shapes later in the code which seems to be connected to the triplane size, not the RGB colour. I guess I need to keep the triplane representation (which I guess stands for the 3D geometry, not colour)...
If anyone could explain me a bit more I would be glad. Thank you :)
The text was updated successfully, but these errors were encountered: