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

Will different image width and height in training set cause errors? #14

Open
wang5566 opened this issue Nov 7, 2017 · 9 comments
Open

Comments

@wang5566
Copy link

wang5566 commented Nov 7, 2017

My training set images'width and height is different, (e.g. width is 80 and height is 200). what the parameter of imgsize should I choose?
and my training set A images' channel is 3 while B images' channel is 1, can I use "--A_channels 3 --B_channels 1 " to run the code?

@duxingren14
Copy link
Owner

duxingren14 commented Nov 7, 2017 via email

@wang5566
Copy link
Author

wang5566 commented Nov 7, 2017

Thank you for your reply. I resize my training set to the same size but when run the code, I got the error message "ValueError: Dimension 1 in both shapes must be equal, but are 0 and 1 for 'concat' (op: 'ConcatV2') with input shapes: [1,0,0,512], [1,1,1,512], [] and with computed input tensors: input[2] = <3>." I don't know what's wrong with my operations? Can you give me some advice?

@duxingren14
Copy link
Owner

duxingren14 commented Nov 7, 2017 via email

@wang5566
Copy link
Author

wang5566 commented Nov 8, 2017

Thank you so much. I got everything done.

@wang5566
Copy link
Author

when I set --A_channels 3 --B_channels 1, I got message "Cannot feed value of shape (1, 256, 256, 3) for Tensor u'real_B:0', which has shape '(1, 256, 256, 1)'",so what can I do?

@o0t1ng0o
Copy link

@wang5566
I also met the problem.

But i check the images, they are all 2562563.
Could u please help us? @duxingren14

Traceback (most recent call last):
File "main.py", line 63, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 58, in main
model.train(args)
File "/home/valentina/DualGAN-master/model.py", line 159, in train
self.run_optim(imgA_batch, imgB_batch, step, start_time)
File "/home/valentina/DualGAN-master/model.py", line 178, in run_optim
feed_dict = {self.real_A: batch_A_imgs, self.real_B: batch_B_imgs})
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 789, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 975, in _run
% (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (1, 256, 256, 1) for Tensor u'real_B:0', which has shape '(1, 256, 256, 3)'

@allen-ash
Copy link

@o0t1ng0o Please check again images in you data set B to see whether it's channels equals to 1.

@xiaoshidai
Copy link

Hello, I want to know if the test sample can be different from the training sample size? If so, what should I do?

@duxingren14
Copy link
Owner

duxingren14 commented Apr 18, 2018 via email

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

5 participants