Fine-Tuning doesn't work

I’m getting user error at fine tunning:

ValueError: in user code:

File "<ipython-input-69-7457531635ed>", line 39, in train_step_fn  *
    losses_dict = model.loss(prediction_dict, true_shape_tensor)
File "/usr/local/lib/python3.7/dist-packages/object_detection/meta_architectures/", line 874, in loss  *
    location_losses = self._localization_loss(
File "/usr/local/lib/python3.7/dist-packages/object_detection/core/", line 78, in __call__  *
    target_tensor = tf.where(tf.is_nan(target_tensor),

ValueError: Shapes must be equal rank, but are 3 and 1 for '{{node Loss/Loss/Select}} = Select[T=DT_FLOAT](Loss/Loss/IsNan, concat_1, Loss/stack_2)' with input shapes: [0], [4,51150,4], [0].

Any help ?

I think your problem is when you calculate the losses_dict . Make sure that you are passing the right parameters at model.loss. I am also hoping that in the total_loss you are the correct losses, but focus on the the point above.

You should make sure you are following the guiding steps properly as instructed on the notebook to calculate the losses_dict correctly.

I have gone through as you suggested but I see nothing wrong with it but there’s still an error.

The error indicates that the problem is there, it could also be in the dependencies. I am suspecting it has something to do with provide_groundtruth.

So I would start from there and trace back. But yes it could also be in other parts of the code, i dont exclude that.