Skip to content

Commit 00e7fa1

Browse files
Fix f-string in color error message (#8639)
1 parent 838ad6c commit 00e7fa1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,9 @@ def _parse_colors(
604604
f"Number of colors must be equal or larger than the number of objects, but got {len(colors)} < {num_objects}."
605605
)
606606
elif not isinstance(colors, (tuple, str)):
607-
raise ValueError("`colors` must be a tuple or a string, or a list thereof, but got {colors}.")
607+
raise ValueError(f"`colors` must be a tuple or a string, or a list thereof, but got {colors}.")
608608
elif isinstance(colors, tuple) and len(colors) != 3:
609-
raise ValueError("If passed as tuple, colors should be an RGB triplet, but got {colors}.")
609+
raise ValueError(f"If passed as tuple, colors should be an RGB triplet, but got {colors}.")
610610
else: # colors specifies a single color for all objects
611611
colors = [colors] * num_objects
612612

0 commit comments

Comments
 (0)