Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion im2txt/im2txt/ops/image_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def process_image(encoded_image,
# only logged in thread 0.
def image_summary(name, image):
if not thread_id:
tf.image_summary(name, tf.expand_dims(image, 0))
tf.summary.image(name, tf.expand_dims(image, 0))

# Decode image into a float32 Tensor of shape [?, ?, 3] with values in [0, 1).
with tf.name_scope("decode", values=[encoded_image]):
Expand Down
8 changes: 4 additions & 4 deletions slim/slim_walkthough.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
},
"outputs": [],
"source": [
"# The following snippet trains the regression model using a sum_of_squares loss.\n",
"# The following snippet trains the regression model using a mean_squared_error loss.\n",
"ckpt_dir = '/tmp/regression_model/'\n",
"\n",
"with tf.Graph().as_default():\n",
Expand All @@ -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.sum_of_squares(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",
Expand Down Expand Up @@ -289,12 +289,12 @@
" predictions, end_points = regression_model(inputs, is_training=True)\n",
"\n",
" # Add multiple loss nodes.\n",
" sum_of_squares_loss = slim.losses.sum_of_squares(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",
" regularization_loss = tf.add_n(slim.losses.get_regularization_losses())\n",
" total_loss1 = sum_of_squares_loss + absolute_difference_loss + regularization_loss\n",
" total_loss1 = mean_squared_error_loss + absolute_difference_loss + regularization_loss\n",
"\n",
" # Regularization Loss is included in the total loss by default.\n",
" # This is good for training, but not for testing.\n",
Expand Down