CycleGAN-TensorFlow icon indicating copy to clipboard operation
CycleGAN-TensorFlow copied to clipboard

tensorflow error raised when calculating "error_fake"

Open iariav opened this issue 7 years ago • 4 comments

Hi, I try training on my own dataset (for images which are not square) but when TF tries to calculate the discriminator "error_fake" for some reason I get that the input and the weights belong to different graphs and thus I get the following error:

"%s must be from the same graph as %s." % (item, original_item)) ValueError: Tensor("Placeholder_1:0", shape=(1, 300, 640, 3), dtype=float32) must be from the same graph as Tensor("D_Y/C64/weights:0", shape=(4, 4, 3, 64), dtype=float32_ref).

it's weird to me since it's very similar to calculating the "error_real" (same D) only here D works on fake_y and not on y.

any idea on where this is coming from? thanks

iariav avatar Jul 25 '17 08:07 iariav

Are all the images the same size?

vanhuyz avatar Jul 25 '17 10:07 vanhuyz

yes. all 300X640X3. both A and B. moreover, it always happens on the first image (which is different every time)

iariav avatar Jul 25 '17 10:07 iariav

Thanks for reporting! At the moment, my implementation can't work with images which are not square. The size of fake images are specified as in https://github.com/vanhuyz/CycleGAN-TensorFlow/blob/master/model.py#L58-L61. This should be fixed in future work.

vanhuyz avatar Jul 25 '17 11:07 vanhuyz

Hi, I made all the necessary changes to be able to work with images which are not square. I now have image_size_h, and image_size_w parameters. good news - apparently I was not working with the latest version, so I took the latest, re-implemented my changes, and now it runs ok!. So either the issue was solved in the latest version or I made a mistake in the first time with the "image_size" changes. Either way, now I cross my fingers for good results :)

thanks

iariav avatar Jul 25 '17 11:07 iariav