numpy - logits and labels must have the same first dimension, got logits shape [1312,48] and labels shape [41] -
i'm building cnn classifing (256,16,1) array (sound @ spectral format) i'm having problems. build graph can't feed y value due logit error:
invalidargumenterror (see above traceback): logits , labels must have same first dimension, got logits shape [1312,48] , labels shape [41]
i've lost hours trying run don't know whats happening....
can please me?
the code of graph:
:: :: tf.name_scope("inputs"): x = tf.placeholder(tf.float32, shape=[none, n_inputs], name="x") x_reshaped = tf.reshape(x, shape=[-1, height, width, channels]) y = tf.placeholder(tf.int32, shape=[none], name="y") training = tf.placeholder_with_default(false, shape=[], name='training') :: :: pool2_fmaps = conv2_fmaps tf.name_scope("pool2"): pool2 = tf.layers.max_pooling2d(inputs=conv2, pool_size=[2, 2], strides=2) pool2_flat = tf.reshape(pool2, shape=[-1, 8 * 1 * pool2_fmaps]) pool2_flat_drop = tf.layers.dropout(pool2_flat, conv2_dropout_rate, training=training) n_fc1 = 512 fc1_dropout_rate = 0.4 tf.name_scope("fc1"): fc1 = tf.layers.dense(pool2_flat_drop, n_fc1, activation=tf.nn.relu, name="fc1") fc1_drop = tf.layers.dropout(fc1, fc1_dropout_rate, training=training) tf.name_scope("output"): logits = tf.layers.dense(fc1_drop, n_outputs, name="output") y_proba = tf.nn.softmax(logits, name="y_proba")
please see gist more info:
https://gist.github.com/denisb411/ccb470ee31d66cdaf647264fb6e20576
Comments
Post a Comment