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

"python gan_64x64.py" met errors #28

Closed
simonxue opened this issue Jun 2, 2017 · 6 comments
Closed

"python gan_64x64.py" met errors #28

simonxue opened this issue Jun 2, 2017 · 6 comments

Comments

@simonxue
Copy link

simonxue commented Jun 2, 2017

I've downloaded ImageNet small dataset (train_64x64.tar and valid_64x64.tar) and modified DATA_DIR in gan_64x64.py. I've also fixed a potential bug at line 116 (lib.concat -> tf.concat). But I still got the following error:

Traceback (most recent call last):
  File "gan_64x64.py", line 477, in <module>
    fake_data = Generator(BATCH_SIZE/len(DEVICES))
  File "gan_64x64.py", line 210, in GoodGenerator
    output = ResidualBlock('Generator.Res3', 2*dim, 2*dim, 3, output, resample='up')
  File "gan_64x64.py", line 186, in ResidualBlock
    he_init=False, biases=True, inputs=inputs)
  File "gan_64x64.py", line 120, in UpsampleConv
    output = lib.ops.conv2d.Conv2D(name, input_dim, output_dim, filter_size, output, he_init=he_init, biases=biases)
  File "/data1/home/weixue/cv/gan/improved_wgan_training/tflib/ops/conv2d.py", line 111, in Conv2D
    data_format='NCHW'
  File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 396, in conv2d
    data_format=data_format, name=name)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
    op_def=op_def)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2329, in create_op
    set_shapes_for_outputs(ret)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1717, in set_shapes_for_outputs
    shapes = shape_func(op)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1667, in call_with_requiring
    return call_cpp_shape_fn(op, require_shape_fn=True)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
    debug_python_shape_fn, require_shape_fn)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 675, in _call_cpp_shape_fn_impl
    raise ValueError(err.message)
ValueError: Dimensions must be equal, but are 256 and 128 for 'Generator.Res3.Shortcut/Conv2D' (op: 'Conv2D') with input shapes: [64,256,32,32], [1,1,128,128].

It seems that the source code is still envolving. Is git "master" in a runnable state?

@simonxue
Copy link
Author

simonxue commented Jun 2, 2017

line 210 in gan_64x64.py:

change

output = ResidualBlock('Generator.Res3', 2*dim, 2*dim, 3, output, resample='up')

to

output = ResidualBlock('Generator.Res3', 4*dim, 2*dim, 3, output, resample='up')

@simonxue
Copy link
Author

simonxue commented Jun 2, 2017

line 358-361 in gan_64x64.py:

change ResidualBlock to BottleneckResidualBlock.

@simonxue
Copy link
Author

simonxue commented Jun 5, 2017

It's runnable now, but is not generating any meaningful pictures. :-(

@parkerzf
Copy link

parkerzf commented Jun 8, 2017

Any update on this? Which tensorflow version do you have?

I use tensorflow-gpu (1.1.0rc2), it has many incompatabilities:

Traceback (most recent call last):
File "gan_64x64.py", line 485, in
fake_data = Generator(BATCH_SIZE/len(DEVICES))
File "gan_64x64.py", line 216, in GoodGenerator
output = Normalize('Generator.OutputN', output)
TypeError: Normalize() takes exactly 3 arguments (2 given)

@simonxue
Copy link
Author

simonxue commented Jun 9, 2017

I've moved to try gan_cifar.py, which could generate meaningful pics.

@igul222
Copy link
Owner

igul222 commented Jun 12, 2017

Sorry for this! the bugs in gan_64x64.py should be fixed now.

@igul222 igul222 closed this as completed Jun 12, 2017
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

3 participants