Skip to content

Commit

Permalink
Modify error message to be more detailed about what is expected, what…
Browse files Browse the repository at this point in the history
… was received and how to resolve
  • Loading branch information
oarriaga committed Feb 23, 2025
1 parent b058a6f commit 8b46ec3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion keras_hub/src/models/yolo_v8/ciou_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ def __init__(
"rel_yxyx",
]
if bounding_box_format not in box_formats:
raise ValueError(f"Invalid box format {bounding_box_format}")
raise ValueError(
f"Invalid bounding box format: '{bounding_box_format}'. "
f"Expected one of {box_formats}. "
"Ensure that the string format is correctly spelled."
)
self.bounding_box_format = bounding_box_format
self.epsilon = epsilon
self.image_shape = image_shape
Expand Down

0 comments on commit 8b46ec3

Please sign in to comment.