xuanjihe / speech-emotion-recognition

speech emotion recognition using a convolutional recurrent networks based on IEMOCAP
389 stars 142 forks source link

Placeholder dimension does not match #23

Closed dyf102 closed 5 years ago

dyf102 commented 5 years ago

File "model.py", line 290, in train_op(1) File "model.py", line 280, in train_op loss, train_acc = sess.run([cost,accuracy],feed_dict = {X:valid_data, Y:valid_label,is_training:False, keep_prob:1}) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 929, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1128, in _run str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (436, 300, 40, 3) for Tensor u'Placeholder:0', which has shape '(?, 200, 40, 3)'

dyf102 commented 5 years ago

@xuanjihe Any suggestion about how to solve this problem?

xuanjihe commented 5 years ago

you just need to modify X = tf.placeholder(tf.float32, shape=[None, 200,40,3]) to X = tf.placeholder(tf.float32, shape=[None, 300,40,3]) in model.py

xuanjihe commented 5 years ago

@xuanjihe Any suggestion about how to solve this problem?

you just need to modify X = tf.placeholder(tf.float32, shape=[None, 200,40,3]) to X = tf.placeholder(tf.float32, shape=[None, 300,40,3]) in model.py

dyf102 commented 5 years ago

Thanks, but It got the following issue. InvalidArgumentError (see above for traceback): logits and labels must be broadcastable: logits_size=[654,6] labels_size=[298,6] [[node softmax_cross_entropy_with_logits_sg (defined at model.py:246) = SoftmaxCrossEntropyWithLogits[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](add_4, softmax_cross_entropy_with_logits_sg/Reshape_1)]]

xuanjihe commented 5 years ago

You can print the shape of the tensor, maybe the dimension of the input features and labels are different