Skip to content

Commit

Permalink
Add dict check for deserialization (#2286)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkovela1 authored Jan 8, 2024
1 parent 7738e2f commit dd4bef2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions keras_cv/models/object_detection/yolo_v8/yolo_v8_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,12 +655,14 @@ def from_config(cls, config):
config["backbone"]
)
label_encoder = config.get("label_encoder")
if label_encoder is not None:
if label_encoder is not None and isinstance(label_encoder, dict):
config["label_encoder"] = keras.saving.deserialize_keras_object(
label_encoder
)
prediction_decoder = config.get("prediction_decoder")
if prediction_decoder is not None:
if prediction_decoder is not None and isinstance(
prediction_decoder, dict
):
config[
"prediction_decoder"
] = keras.saving.deserialize_keras_object(prediction_decoder)
Expand Down

0 comments on commit dd4bef2

Please sign in to comment.