dshieble / Music_RBM

Use TensorFlow to generate short sequences of music with an RBM
26 stars 15 forks source link

AttributeError: 'module' object has no attribute 'While' #3

Closed RahulBhalley closed 6 years ago

RahulBhalley commented 7 years ago

I am getting the following error:

122 songs processed
Traceback (most recent call last):
  File "rbm_chords.py", line 87, in <module>
    x_sample = gibbs_sample(1) 
  File "rbm_chords.py", line 77, in gibbs_sample
    [_, _, x_sample] = control_flow_ops.While(lambda count, num_iter, *args: count < num_iter,
AttributeError: 'module' object has no attribute 'While'
gofornaman commented 6 years ago

did you solve it?

RahulBhalley commented 6 years ago

Since newer version of TensorFlow replaced While with while_loop replace lines 77 and 78 with

[_, _, x_sample] = control_flow_ops.while_loop(lambda count, num_iter, *args: count < num_iter, gibbs_step, [ct, tf.constant(k), x], parallel_iterations=1, back_prop=False)

For removing further possible errors: