Zardinality / WGAN-tensorflow

a tensorflow implementation of WGAN
579 stars 201 forks source link

cannot find deform_conv_2d function #8

Closed 1973Blunt closed 7 years ago

1973Blunt commented 7 years ago

Thanks to share the code. There is a call for 'deform_conv_2d' in critic_conv function of WGAN.ipynb. But I could not find the definition. Is it 'ly.conv2d'?

Zardinality commented 7 years ago

Sorry I was completely out of my mind when I add the latest commit, somehow I mistake this notebook with one of my other repos. Now it's fixed. Do you mind checking whether it works now?

1973Blunt commented 7 years ago

Thanks for the quick reply. Yes, it works. But there are some other problem.
In 'WGAN.ipynb', I change

alpha_dist = tf.contrib.distributions.Uniform(low=0., high=1.)

to

alpha_dist = tf.contrib.distributions.Uniform(0., 1.)

Because my tensorflow version is 1.0.1, and 'Uniform' api is different with tf 1.0.0. In 'generate_from_ckpt.ipynb', I change

ckpt_dir = './ckpt_wgan_svhn'

to

ckpt_dir = './ckpt_wgan'

in accord with 'WGAN.ipynb'.

I believe they are not big issues. Now, I'm stuck with running 'generate_from_ckpt.ipynb'. It raise error from

saver.restore(sess, tf.train.latest_checkpoint(ckpt_dir))

Main error info:

tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [3,3,3,64] rhs shape= [3,3,1,64]

[[Node: save/Assign_13 = Assign[T=DT_FLOAT, _class=["loc:@generator/Conv2d_transpose_3/weights"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](generator/Conv2d_transpose_3/weights, save/RestoreV2_13/_3)]]

Zardinality commented 7 years ago

I've fix the generator's channel in WGAN.ipynb. And just a side note in case you didn't notice, you should set is_svhn to the proper value.

1973Blunt commented 7 years ago

Thanks a lot! It works.