ofirnachum / sequence_gan

Generative adversarial networks (GAN) applied to sequential data via recurrent neural networks (RNN).
395 stars 124 forks source link

Error While Compiling Book Demo #1

Closed NickShahML closed 8 years ago

NickShahML commented 8 years ago

Hey Ofir,

Thanks for building this script. I had this error come up running your script out of the box.

num words 48
stream length 100027
distinct 3-grams 5061
Traceback (most recent call last):
  File "book_demo.py", line 110, in <module>
    main()
  File "book_demo.py", line 92, in main
    trainable_model = get_trainable_model(num_words)
  File "book_demo.py", line 60, in get_trainable_model
    SEQ_LENGTH, START_TOKEN)
  File "/home/nick/Project_RNN_Enhancement/sequence_gan/model.py", line 205, in __init__
    self.g_grad = tf.gradients(self.g_loss, self.g_params)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gradients.py", line 481, in gradients
    in_grads = _AsList(grad_fn(op, *out_grads))
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_grad.py", line 186, in _EnterGrad
    result = grad_ctxt.AddBackPropAccumulator(grad)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 1432, in AddBackPropAccumulator
    shape = value.get_shape()
AttributeError: 'IndexedSlices' object has no attribute 'get_shape'

Can I ask what version of tensorflow you are using to run the script? I had to get rid of the input_shape arguments to even get it to this point. I'm thinking that you ran it on tensorflow 0.8?

I ran this in tensorflow version 0.8 and this error arises.

Thanks!

ofirnachum commented 8 years ago

I compiled tensorflow from source at commit 504e8a6ac678f83f88862b3826d54bb9b484cc33

What input_shape arguments do you mean?

NickShahML commented 8 years ago

Hey Ofir, thanks for letting me know the commit -- I will try building from there.

I'm sorry -- instead of input_shape, I meant infer_shape found on lines 65 and 67 in your model.py

I'll post back once I've compiled from source and ran it.

NickShahML commented 8 years ago

Posting back, installing tensorflow with a nightly build resolved all issues:

http://ci.tensorflow.org/view/Nightly/job/nigntly-matrix-linux-gpu/TF_BUILD_CONTAINER_TYPE=GPU,TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=gpu-linux/126/

Thanks for your help. If I make any improvements or findings, I will raise a separate issue. Thanks again for writing this script! Very useful.