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

how to projector no squar images? #14

Open
dayu1979 opened this issue May 22, 2020 · 1 comment
Open

how to projector no squar images? #14

dayu1979 opened this issue May 22, 2020 · 1 comment

Comments

@dayu1979
Copy link

After successfully training StyleGAN 2 on a dataset of (1024, 768), I tried using the network for projecting real images into latent space. Unfortunately I'm getting an error as shown below. Traceback (most recent call last):
File "run_projector.py", line 146, in
main()
File "run_projector.py", line 141, in main
dnnlib.submit_run(sc, func_name_map[subcmd], **kwargs)
File "/home/dayu/D/src2000/stylegan2_skyfly/dnnlib/submission/submit.py", line 343, in submit_run
return farm.submit(submit_config, host_run_dir)
File "/home/dayu/D/src2000/stylegan2_skyfly/dnnlib/submission/internal/local.py", line 22, in submit
return run_wrapper(submit_config)
File "/home/dayu/D/src2000/stylegan2_skyfly/dnnlib/submission/submit.py", line 280, in run_wrapper
run_func_obj(**submit_config.run_func_kwargs)
File "/home/dayu/D/src2000/stylegan2_skyfly/run_projector.py", line 59, in project_real_images
proj.set_network(Gs)
File "/home/dayu/D/src2000/stylegan2_skyfly/projector.py", line 103, in set_network
proc_images_expr = tf.reduce_mean(tf.reshape(proc_images_expr, [-1, sh[1], sh[2] // factor, factor, sh[2] // factor, factor]), axis=[3,5])
File "/home/dayu/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 7715, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "/home/dayu/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/home/dayu/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/dayu/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 3616, in create_op
op_def=op_def)
File "/home/dayu/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 2027, in init
control_input_ops)
File "/home/dayu/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1867, in _create_c_op
raise ValueError(str(e))
ValueError: Dimension size must be evenly divisible by 3145728 but is 2359296 for 'Reshape' (op: 'Reshape') with input shapes: [1,3,1024,768], [6] and with input tensors computed as partial shapes: input[1] = [?,3,256,4,256,4].

@Anas-Khayata
Copy link

Anas-Khayata commented Aug 25, 2021

@skyflynil @dayu1979
do you have any solution for projection to latent space for non-square images?
I am also having the same error

Thanks

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