At Exercice 6.1, when running vars(tmp_box_predictor_checkpoint)
I get the following output
{'_save_counter': None,
'_save_assign_op': None,
'_self_setattr_tracking': True,
'_self_unconditional_checkpoint_dependencies': [TrackableReference(name=_base_tower_layers_for_heads, ref={'box_encodings': ListWrapper([]), 'class_predictions_with_background': ListWrapper([])}),
TrackableReference(name=_box_prediction_head, ref=<object_detection.predictors.heads.keras_box_head.WeightSharedConvolutionalBoxHead object at 0x7f528025c3d0>)],
'_self_unconditional_dependency_names': {'_base_tower_layers_for_heads': {'box_encodings': ListWrapper([]),
'class_predictions_with_background': ListWrapper([])},
'_box_prediction_head': <object_detection.predictors.heads.keras_box_head.WeightSharedConvolutionalBoxHead at 0x7f528025c3d0>},
'_self_unconditional_deferred_dependencies': {},
'_self_update_uid': -1,
'_self_name_based_restores': set(),
'_self_saveable_object_factories': {},
'_base_tower_layers_for_heads': {'box_encodings': ListWrapper([]),
'class_predictions_with_background': ListWrapper([])},
'_box_prediction_head': <object_detection.predictors.heads.keras_box_head.WeightSharedConvolutionalBoxHead at 0x7f528025c3d0>,
'_saver': <tensorflow.python.training.tracking.util.TrackableSaver at 0x7f5288fc7590>,
'_attached_dependencies': None}
instead of getting
'_base_tower_layers_for_heads': DictWrapper({'box_encodings': ListWrapper([]), 'class_predictions_with_background': ListWrapper([])}),
'_box_prediction_head': <object_detection.predictors.heads.keras_box_head.WeightSharedConvolutionalBoxHead at 0x7fefac014710>,
which I believe is the reason why I can’t calculate the loss function of exercice 9
# Calculate the loss after you've provided the ground truth
losses_dict = detection_model.loss(prediction_dict, true_shape_tensor)
and I get the following error message
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-113-36f83e7403b4> in <module>
1 # Calculate the loss after you've provided the ground truth
----> 2 losses_dict = detection_model.loss(prediction_dict, true_shape_tensor)
3
4 # View the loss dictionary
5 losses_dict = detection_model.loss(prediction_dict, true_shape_tensor)
4 frames
/usr/local/lib/python3.7/dist-packages/object_detection/utils/shape_utils.py in assert_shape_equal(shape_a, shape_b)
319 all(isinstance(dim, int) for dim in shape_b)):
320 if shape_a != shape_b:
--> 321 raise ValueError('Unequal shapes {}, {}'.format(shape_a, shape_b))
322 else: return tf.no_op()
323 else:
ValueError: Unequal shapes [2], [91]
Does anyone would have any idea what am I doing wrong?
Thanks a lot