Browse Source

Update to use tf.losses.mean_squared_error

Neal Wu 8 năm trước cách đây
mục cha
commit
48f5b4dab7
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      slim/slim_walkthough.ipynb

+ 2 - 2
slim/slim_walkthough.ipynb

@@ -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",