|
@@ -244,7 +244,7 @@
|
|
|
" predictions, nodes = regression_model(inputs, is_training=True)\n",
|
|
|
"\n",
|
|
|
" # Add the loss function to the graph.\n",
|
|
|
- " loss = slim.losses.mean_squared_error(predictions, targets)\n",
|
|
|
+ " loss = tf.losses.mean_squared_error(labels=targets, predictions=predictions)\n",
|
|
|
" \n",
|
|
|
" # The total loss is the uers's loss plus any regularization losses.\n",
|
|
|
" total_loss = slim.losses.get_total_loss()\n",
|
|
@@ -289,7 +289,7 @@
|
|
|
" predictions, end_points = regression_model(inputs, is_training=True)\n",
|
|
|
"\n",
|
|
|
" # Add multiple loss nodes.\n",
|
|
|
- " mean_squared_error_loss = slim.losses.mean_squared_error(predictions, targets)\n",
|
|
|
+ " mean_squared_error_loss = tf.losses.mean_squared_error(labels=targets, predictions=predictions)\n",
|
|
|
" absolute_difference_loss = slim.losses.absolute_difference(predictions, targets)\n",
|
|
|
"\n",
|
|
|
" # The following two ways to compute the total loss are equivalent\n",
|