1、initialize_all_variables已被弃用。
说明更新:使用tf.global_variables_initializer代替,写了 init = tf.global_variables_initializer()后不会执行,要在session里加上sess.run(init)后才会执行。
2、Only call sparse_softmax_cross_entropy_with_logits
with named arguments (labels=…, logits=…, …)
tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=y_),需要指定参数名。改为
cost_func = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=Y,logits=predict))。