pannous / tensorflow-speech-recognition

🎙Speech recognition using the tensorflow deep learning framework, sequence-to-sequence neural networks
Other
2.17k stars 638 forks source link

Error while reshaping tensors #9

Closed roshankarwalkar1 closed 8 years ago

roshankarwalkar1 commented 8 years ago

I am facing problem in reshaping my tensors. Right now I am running train.py from your source but I got the following error:

File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 625, in _run
    % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (100, 4096) for Tensor 'Placeholder:0', which has shape '(?, 262144)'

this is my code snippet

for i in range(6000-1):
    batch_xs, batch_ys = speech.train.next_batch(100)
    # WTF, tensorflow can't do 3D tensor operations?
    # https://github.com/tensorflow/tensorflow/issues/406 =>

    batch_xs=[flatten(matrix) for matrix in batch_xs]

    #batch_ys = np.reshape(batch_ys, (100,4096))
    #batch_xs = np.reshape(batch_xs, (4096,100))

    #  you have to reshape to flat/matrix data? why didn't they call it matrixflow?
    feed = {x: batch_xs, y_: batch_ys}
    speech_step.run(feed) # better for encod_entropy too! (later)
    if(i%100==0):
        print("iteration %d"%i)#, end=' ')
        eval(feed)
    if((i+1)%7000==0):
      print("l_rate*=0.1")
      sess.run(tf.assign(l_rate,l_rate*0.1))
  print("Train")