Models: unexpected behavior with slim.losses.add_loss

Created on 18 Oct 2016  路  3Comments  路  Source: tensorflow/models

I am playing around with slim_walkthrough (it has a typo in the name) and I have noticed if I change the line :
loss = slim.losses.mean_squared_error(predictions, targets)
with:
loss = tf.contrib.losses.mean_squared_error(predictions, targets)
slim.losses.add_loss(loss)
I get different loss values even though I expected them to be the same.

awaiting model gardener

Most helpful comment

i got error at this line.

loss = slim.losses.sum_of_squares(predictions, targets)

AttributeError Traceback (most recent call last)
in ()
11
12 # Add the loss function to the graph.
---> 13 loss = slim.losses.sum_of_squares(predictions, targets)
14 #loss = slim.losses.mean_squared_error(predictions, targets)
15

AttributeError: module 'tensorflow.contrib.losses' has no attribute 'sum_of_squares'

All 3 comments

@nathansilberman @sguada : Could one of you take a look?

i got error at this line.

loss = slim.losses.sum_of_squares(predictions, targets)

AttributeError Traceback (most recent call last)
in ()
11
12 # Add the loss function to the graph.
---> 13 loss = slim.losses.sum_of_squares(predictions, targets)
14 #loss = slim.losses.mean_squared_error(predictions, targets)
15

AttributeError: module 'tensorflow.contrib.losses' has no attribute 'sum_of_squares'

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings