1 为train和test分别写好loss cost = tf.losses.mean_squared_error(y, predict) loss = tf.sqrt(tf.reduce_mean(cost))#rmse tf.summary.scalar('train_loss',loss